Skip to content
Branching and merging

Fast-forward and true merges

Two outcomes that look the same and are not.

If nothing has happened on your branch since the other one split off, there is nothing to merge: git moves your branch label forward and stops. That is a fast-forward, and the history stays a straight line.

If both branches have moved, git builds a commit with two parents. The first parent is where you were, the second is what you brought in — and that order is why `git log --first-parent` can show you your own branch's story without the merged work interleaved.

`--no-ff` forces a merge commit even when a fast-forward was possible, which some teams use to keep a record that a branch existed at all.

Commands in this lesson

git merge
Join another branch's history into this one
git merge-base
Find the commit two branches diverged from
No account, no backend. Everything you do stays in this browser.liter8.sh