Git: Find the most recent common ancestor of two branches

Ted picture Ted · Oct 10, 2009 · Viewed 163.4k times · Source

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

Answer

CB Bailey picture CB Bailey · Oct 10, 2009

You are looking for git merge-base. Usage:

$ git merge-base branch2 branch3
050dc022f3a65bdc78d97e2b1ac9b595a924c3f2