Search code examples
gitgit-diff

Git - Compare commits on different branches


Say we have the following branches:

aaa --> bbb --> ccc --> ddd (HEAD) Branch A

eee --> fff --> ggg Branch B

Would it be possible to compare bbb (on Branch A) with eee (on Branch B)?

The following compares the tip of the branches (afaik):

git diff A..B

While the following compares commits on the same branch:

git diff ddd..ccc

Would it be possible to merge these parameters?


Solution

  • Try with compare commit heads

    git diff head first branch head second branch

    git diff 0dae34e  769ffr330c