Files
rootnode-academy/content/root/root-03-git-collaborative-development/m04-branching-and-merging/02-demonstration-a-conflict-happening-live.md
T
ced4568andClaude Sonnet 5 e68b6f445a feat(root03): author Git & Collaborative Development
Adds all 6 ROOT 03 modules (why version control exists, the Git mental model, everyday Git,
branching & merging, remote repositories, engineering Git workflow) — 31 activities. Uses only
real LOCAL Git repositories throughout — no Gitea account, no network access, and no
RootNode-canonical-repo credential is ever needed or exposed in a student Lab
(docs/ROOT_FOUNDATIONS_LAB_STRATEGY.md §4). Modules 1, 2, and 6 are conceptual bookends with no
lab, matching the flexible readiness standard already used in ROOT 01/02.

Adds 3 new hands-on Git scenarios plus 2 MCQs: git-everyday-basics (init/add/commit, validated
by inspecting real `git log`/`git show` state, not just command output strings — Step 6's
explicit requirement), git-branching-and-merge (a REAL merge conflict caused on purpose by two
branches editing the same line, resolved by the student, validated by confirming the conflict
markers are gone and a real two-parent merge commit exists), and git-remote-clone-push (a real
local bare repository standing in for a remote — clone/commit/push validated by inspecting the
REMOTE side directly, not just the student's own clone). All tested end-to-end via the real
scenario-validation API, including negative tests.

Wires rootnode-git-fundamentals-assessment (2 required + 3 random-draw scenarios) using the
existing Phase 3B assessment engine.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-08-26 17:08:00 -05:00

1.4 KiB

Demonstration: A Conflict, Caused and Resolved on Purpose

OBSERVE

Two branches both changed line 1 of config.txt — main to "env=production", feature to "env=staging".

HYPOTHESIS

Predict what git merge feature will do.

INSPECT

$ git merge feature
Auto-merging config.txt
CONFLICT (content): Merge conflict in config.txt
Automatic merge failed; fix conflicts and then commit the result.

Exactly as predicted — Git refuses to guess.

CHANGE

$ cat config.txt
<<<<<<< HEAD
env=production
=======
env=staging
>>>>>>> feature

Decide the real answer — here, say env=production is correct — and edit the file to exactly that, deleting all three marker lines.

VERIFY

$ git add config.txt
$ git commit -m "Merge feature, keep production config"
$ git log --oneline --graph
*   a1b2c3d Merge feature, keep production config
|\
| * 9f8e7d6 Update from feature
* | 3d2c1b0 Update from main
|/
* 0a1b2c3 Initial commit

The graph shows exactly what happened: two lines of history, deliberately combined.

Instructor Notes

Demo goal: Walk a real conflict from cause to resolution without skipping any step, reinforcing that resolution means making an explicit CHOICE, not applying a trick.

Approximate timing: 10 minutes live.

Common mistake to watch for: leaving conflict markers accidentally in the "resolved" file (easy to miss one) — grep '<<<<<<<' file before committing catches this reliably.