如何检查本地 GIT 存储库和远程存储库之间的更改?

How can I check the changes between my local GIT repository and the remote one?

我不是很喜欢 GIT 我有以下问题。

我在 BitBucket 上有一个存储库,我必须 "update" 我的项目到 BitBucket 存储库上的项目的最新版本。

所以我尝试执行 git pull 语句,但我收到此消息:

$ git pull
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 8 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.
From https://bitbucket.org/akakunin/userreg
   ef0c08d..692dc31  master     -> origin/master
error: Your local changes to the following files would be overwritten by merge:
        userreg-esb/src/main/synapse-config/api/user_registration.xml
Please commit your changes or stash them before you merge.
Aborting
Updating ef0c08d..692dc31

所以我的疑惑是:

1) 如何检查我的本地存储库和 BitBucket 存储库之间更改了哪些文件?

2) 如何查看这些更改? (我想知道我的本地存储库和 BitBucket 版本之间更改了哪一行代码以及什么文件 added\deleted)

错误消息告诉您哪些文件停止了拉取请求:

userreg-esb/src/main/synapse-config/api/user_registration.xml

可以在 @Code-Apprentice:

的答案中找到有关如何区分更改的更多详细信息

If [remote-path] and [local-path] are the same, you can do

$ git fetch origin master

$ git diff origin/master -- [local-path]

Note 1: The second command above will compare against the locally stored remote tracking branch. The fetch command is required to update the remote tracking branch to be in sync with the contents of the remote server. Alternatively, you can just do

$ git diff master:<path-or-file-name>

Note 2: master can be replaced in the above examples with any branch name