# 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.