'How to compare HEAD commit from one branch with HEAD commit from another branch in Git?
I have 2 local branches, branch1 and newer_branch1.
branch1 has commit#1 as the HEAD commit and so does newer_branch1, but I don't know if branch1 is actually up to date with newer_branch1, as newer_branch1 has the most recent version of the commit. They also have the same exact commit messages so I can't simply tell they're different commit versions based on commit text.
I tried to view only the HEAD commit diffs with git diff ID#X..ID#Y (where ID#X is the SHA ID# of newer_branch1 HEAD commit, and ID#Y is the SHA ID# of branch1) but I am seeing older commits from the git log being diff'd instead.
How can I do this? Thanks.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
