0 votes
1 view
in DevOps and Agile by (20k points)

How to find the most recent common ancestor of two Git branches?

1 Answer

0 votes
by (28.4k points)

The command, git merge-base will work like a charm in this case:

$ git merge-base featureBranch developBranch

Additional info: If featureBranch is your current branch, you can use use '--fork-point' as shown below:

$ git merge-base --fork-point develop

Also, for full commit info you can use this command:

$ git log -1 $(git merge-base --fork-point develop)

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...