To add to the contribution manojlds:
Very nice. But then the following should do the same?
git diff master:some_file.txt someBranch:some_file.txt
this way you don't need to check before using caching
Original answer:
Command
git log HEAD..other_branch -- some_file.txt
coincides with
git log ^HEAD other_branch -- some_file.txt
which means giving me a log of all the commits available from other_branch but not accessible from HEAD for some_file.txt. If this command does not give you an exit, it means that some_file.txt has not changed at all to other_branch.
On the other hand:
git log HEAD...other_branch -- some_file.txt
is the symmetric difference between HEAD and other_branch, i.e. commits that are in HEAD and in other_branch, but not both, are the commits that will be merged when the two branches merge. So something happened with some_file.txt on HEAD, which caused this conflict with the version on other_branch
source share