Real, Independent Work on Both Sides
# feature/spice-rack gets its own real commits
# master, separately, gains freezer-labels.md
Neither side is a simple ancestor of the other anymore — genuine, true divergence.
Tracing the Real Common Ancestor by Hand
git merge-base master feature/spice-rack
The exact real commit both branches share as their most recent common point — found by git, but genuinely knowable by hand too, by reading the log carefully.
The Three Real Commits Git Actually Compares
A three-way merge is named for exactly three inputs: the real common ancestor, master's real current tip, and the branch's real current tip. git compares each side's changes against the shared ancestor — which is precisely why independent changes to different files (or different lines) usually combine automatically, with no conflict at all.
Performing the Real Merge
git merge --no-ff feature/spice-rack -m "Merge pull request: spice rack guide"
A real merge commit with two genuine parents — master's tip and the branch's tip — both real, independent lines of work combined into one.
feature/spice-rack gains its own real commits while master, independently, gains a genuinely different one. Neither side is "behind" the other in the simple sense from Lesson 2.3.1 — this is real, true divergence, and the merge that follows has to be a genuine three-way comparison, not a simple pointer move.
Before running the merge, this lesson traces by hand exactly what git itself will compare: the real common ancestor (found with git merge-base), master's real tip, and the branch's real tip. Seeing all three explicitly is what makes it clear why git can often combine genuinely independent changes automatically.
git merge-base a b
Finds the real, most recent commit both a and b share as an ancestor — the actual starting point git uses for a three-way merge. Confirmed directly in this lab: it returned the exact real merge commit both branches had genuinely diverged from.
Three-way merge
A merge where git compares three real inputs — the common ancestor, and each side's current tip — rather than simply moving a pointer. Confirmed directly in this lab combining two genuinely independent files (spice-rack.md and freezer-labels.md) with zero conflict, since neither side touched what the other changed.
Takeaways
- git merge-base a b finds the real, most recent commit two branches genuinely share
- A three-way merge compares exactly three real inputs: the common ancestor, and each side's current tip
- Independent changes — different files, or different sections of the same file — usually combine automatically
- Real conflicts come from genuine overlap on the same lines, not simply from a large amount of divergence