Watch git merge create a two-parent merge commit on an animated commit graph. See exactly when fast-forward is impossible because branches diverged.
Scenario
Branch state
Current step 9/9
$ git merge feature
The histories diverged so fast-forward is impossible — a merge commit with two parents is created. (If main hadn't moved, the pointer would just slide forward — that's FF.)
$ git log --oneline --all
c6 (HEAD -> main) Merge branch 'feature'
c5 hotfix
c4 (feature) feat B
c3 feat A
c2 base feature
c1 init
File content (at HEAD) — app.js @ main
Circles are commits; dimmed circles were abandoned by rebase/reset. A prime (c3') means same content, rewritten hash. In sandbox mode, run commands yourself with the buttons.
git merge joins two diverged lines of history back together. If your branch hasn't moved since the split, Git just slides the pointer forward — that's a fast-forward, and no new commit appears. But when both sides have new commits, Git creates a merge commit with two parents.
The two parents are the key: the first is your branch's previous tip, the second is the merged branch's tip. The Y-shape you see in git log --graph exists because of them. When there's no conflict, the merge commit is a snapshot containing both sides' changes.
Watch the scenario and compare what happens before and after main gets its own commit. Had main stayed put, the pointer would simply have slid to feature's tip. Because main moved, Git needs a real merge commit to join the histories. Git Branch Simulator