C E
| /
B D
| /
A
How to get the SHA of the commit A
if E
is the current HEAD
?
C E
| /
B D
| /
A
How to get the SHA of the commit A
if E
is the current HEAD
?
When trying to get SHA of base commit for a current branch this is useful:
git merge-base --fork-point <main branch>
If finding the common ancestor of the branches C and E is what you need, then:
git merge-base <hash of commit C> <hash of commit E>
You can see git log [options]
and find the started commit of a specific branch.
$ git log --oneline --decorate --all --graph