I'd like to determine whether two Git branches have diverged or whether one of the branches could simply be fast forwarded to the other branch.
In other words, I want to check whether the current HEAD of one of the branches has been merged into the other branch at some point or if it contains commits that are not in the other branch.
Is there a way to do this without actually merging the two branches? A simple git diff
does not help in this case.
You can use git merge-base
A description can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With