Reputation: 3070
C E
| /
B D
| /
A
How to get the SHA of the commit A
if E
is the current HEAD
?
Upvotes: 3
Views: 3203
Reputation: 9597
When trying to get SHA of base commit for a current branch this is useful:
git merge-base --fork-point <main branch>
Upvotes: 3
Reputation:
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>
Upvotes: 2
Reputation: 24174
You can see git log [options]
and find the started commit of a specific branch.
$ git log --oneline --decorate --all --graph
Upvotes: 1