git diff/difftool

 

Good reference text: Using the Command and P4Merge be diff :: https://www.cnblogs.com/cgzl/p/8597066.html

g to pop comparison tool interface it difftool ha ha

 

===========================

Local area

git diff/difftool  filepath

Without any command parameters, workspace (local file) compared to the staging area, if not followed by filepath, compare all different. Filepath Hinako file or folder can be.

 

git diff/difftool  HEAD  filepath

Workspace with the HEAD ( the current working branch, the last commit) comparison.

 

git diff/difftool --staged filepath

Compared with the staging area HEAD  

 

git diff commitIDx commitIDy

The differences between the two commit, commitIDx and commitIDy have expressed id commit, the last commit can be expressed HEAD.  commitIDy content displayed on the right screen.

git diff HEAD HEAD^

Compare that once the HEAD and HEAD

 

git diff branchName filepath  

The current branch file (filepath) and compare branchName branch files!  

expand:

git diff branch1 branch2 - path / file.txt (may not be added -)

Comparison of the two branches of the same file can ,, branch when the distal end of origin / branch1; if the specified file, then all the comparison of two different branches.

 

 

git diff commitId filepath compared with a previous commit - to be verified

 

Local vs distal

git diff/difftool branchX origin/branchY

This is a comparison of local branchX branch and remote branchY branch can also be used to compare two local branches!

 

Guess you like

Origin www.cnblogs.com/butterflybay/p/11272516.html
Git