Git Made Crystal Clear · chapter 5: Branching and Merging Without Fear

Fast-forward vs three-way merge

2026-10-26

Top lane: no divergence, so main simply moves forward. Bottom lane: both lines advanced, so Git records merge commit M with two parents.

Below: the paragraph from the book that builds this idea, then the diagram itself (Figure 5.2), and a recap. About a minute of reading.

A fast-forward happens when the current branch is a direct ancestor of the branch you are merging: nothing diverged, so Git just slides the pointer forward. No merge commit is created. A three-way merge happens when both branches have new commits since they split: Git combines the two lines and records a merge commit with two parents. If you want a merge commit even when a fast-forward is possible, use git merge --no-ff.

Figure 5.2: Fast-forward vs three-way merge. Top lane: no divergence, so main simply moves forward. Bottom lane: both lines advanced, so Git records merge commit M with two parents.
Figure 5.2: Fast-forward vs three-way merge. Top lane: no divergence, so main simply moves forward. Bottom lane: both lines advanced, so Git records merge commit M with two parents.

Recap

  • The idea: Top lane: no divergence, so main simply moves forward.
  • The picture: Figure 5.2, from chapter 5 ("Branching and Merging Without Fear") of Git Made Crystal Clear.
  • Go deeper: the chapter builds this step by step, with recipes and sources at the end.

This diagram is one of many in Git Made Crystal Clear.

Every chapter opens with the gist, draws the hard ideas, and ends with recipes and sources.

Get the book

All diagrams