In Git, the merge-base of two branches is the most recent commit that both share, meaning their best common ancestor. Git uses it to work out what changed on each branch since they diverged, which is the basis for a three-way merge. The command git merge-base followed by two branch names prints it.

It matters in practice because many comparisons depend on it. A pull request diff, for example, typically shows the changes made on a branch since it split from the target branch, not every difference between the two branch tips, and the merge-base defines that starting point.

It is not always a single obvious commit. After repeated merges between branches, there can be more than one equally good common ancestor, and rebasing a branch changes which commit counts as the common ancestor. Because of this, a diff or merge result can look different after a rebase or after the target branch moves.

When a merge or diff looks unexpected, find the merge-base for the two branches and compare changes from there. Understanding it also helps explain why long-lived branches tend to produce more conflicts, since more changes accumulate on both sides.