2016-11-16 60 views

回答

2

您可以檢查遠程分支的引用日誌來查看提交這是對你拉到面前:

$ git reflog origin/master    # <- 'origin/master', not 'master' 
3ab2281 refs/remotes/origin/[email protected]{0}: pull: fast-forward # <-last pull 
3cdd5d1 refs/remotes/origin/[email protected]{1}: fetch: fast-forward # <-previous pull 
cda1bbd refs/remotes/origin/[email protected]{2}: fetch: fast-forward 
5b18e70 refs/remotes/origin/[email protected]{3}: fetch: fast-forward 
... 

然後,您可以查看最後兩個上市提交的DIFF:

$ git diff 3cdd5d1 3ab2281   # usual diff in terminal 
# or 
$ git difftool -d 3cdd5d1 3ab2281 # graphical diff viewer 

要簡單地查看已修改文件的列表以及一個小標記A dded,M已更改或D已選:

$ git diff --name-status 3cdd5d1 3ab2281 
M  .travis.yml 
M  Documentation/RelNotes/2.10.2.txt 
M  Documentation/RelNotes/2.11.0.txt 
M  Documentation/config.txt 
M  Documentation/diff-config.txt 
... 
相關問題