Last Updated: February 25, 2016
·
4.872K
· klj613

git diff .. vs ...

Do you actually know the different between .. and ...? and which one you should use?

To figure out which one you would use you got to know what they actually do...

o-o-X-o-o-o-o-Z master
     \
     -o-o-o-o-o-Y feature-x

git diff master...feature-x will actually do git diff X Y

git diff master..feature-x will actually do git diff Z Y

Both ... and .. will generate the same diff if feature-x contains the latest of master, like:

o-o-X master
     \
     -o-o-o-o-o-Y feature-x

or

o-o-X-o-o-o-o-Z master
     \         \
     -o-o-o-o-o-Y feature-x