Predicting Before Running Anything
git log --oneline master..feature/oven-temps
git log --oneline feature/oven-temps..master
Real commits ahead on the branch, genuinely nothing on master's side — the real precondition for a fast-forward.
Verifying the Real Fast-Forward
git switch master
git merge feature/oven-temps
git's own real output says "Fast-forward" — the branch pointer simply advances, since there was nothing to combine.
Forcing the Opposite, On Purpose
git merge --no-ff feature/fridge-organization -m "Merge pull request: fridge organization tips"
The exact same real starting condition (a branch directly ahead) — but --no-ff genuinely forces a merge commit anyway, "Merge made by the 'ort' strategy" appearing even though nothing required it.
Why Force It
A fast-forward leaves no real trace that a feature branch ever existed — its commits blend invisibly into master's own line. A forced merge commit is a real, permanent, searchable marker: "this exact feature was integrated here," useful for tooling, changelogs, and anyone reading history later who wants to know what shipped together.
feature/oven-temps was branched off master's current tip, and master has not received a single new commit since. Before merging, the real, answerable question is: will this be a fast-forward, or will git create a real merge commit?
This lesson proves the prediction, then deliberately does the opposite on an equivalent second branch — forcing a real merge commit with --no-ff even though a fast-forward was just as possible. The same real starting condition, two genuinely different real outcomes, entirely by choice.
Fast-forward merge
When the target branch has made no commits since the source branch diverged, git can genuinely just move the target's pointer forward — no new commit, no combining, since there is nothing to combine. Confirmed directly in this lab: "Updating da919ea..c926ae3 / Fast-forward" with no merge commit created.
git merge --no-ff
Forces a real merge commit even when a fast-forward is technically possible. Confirmed directly in this lab on an equivalent starting condition to the fast-forward above: "Merge made by the 'ort' strategy" appeared instead, by deliberate choice.
Takeaways
- A fast-forward happens automatically whenever the target branch has made no commits since the source diverged
- git merge --no-ff forces a real merge commit even when a fast-forward would otherwise occur
- Neither outcome is more "correct" — the real trade-off is traceability versus a cleaner, more linear history
- A team that always uses --no-ff gets a permanent, searchable record of every feature's integration point