Your first merge conflict, on purpose — so the first one that happens by accident, maybe during Exam 1, isn't a surprise.
By today your team has been through one full weekly sync-and-PR cycle (Day 1–2 homework, due Sunday). That's enough git muscle memory to safely break something on purpose. A merge conflict just means git found two changes to the same lines and can't guess which one you want — it's not an error, it's a question. Today's goal is to make that question feel routine before Exam 1 (Tue 10/6, two and a half weeks out).
Pair up with one teammate. You'll both edit the exact same line of the exact same file, on purpose.
git checkout -b conflict-drill-ascratch/conflict_practice.mdFAVORITE PLOT: ___ — fill in your answergit add . && git commit -m "A: favorite plot"git push origin conflict-drill-agit checkout -b conflict-drill-bgit add . && git commit -m "B: favorite plot"git push origin conflict-drill-bBoth of you open a Pull Request into main. Partner A merges first — that one goes through clean. Partner B's PR now shows a conflict. That's the moment we're here for.
Partner B: pull the now-updated main into your branch (git checkout main && git pull, then git checkout conflict-drill-b && git merge main). Open the file. It looks like this:
<<<<<<< HEAD FAVORITE PLOT: scatter plot ======= FAVORITE PLOT: heatmap >>>>>>> conflict-drill-b
Everything between <<<<<<< HEAD and ======= is what's already on main (Partner A's). Everything between ======= and >>>>>>> is yours. Git is not confused — it's handing you the decision because only a human can make it.
<<<<<<<, =======, >>>>>>>) and leave only the final text.git add scratch/conflict_practice.mdgit commit -m "resolve favorite-plot conflict"git push origin conflict-drill-b, then the PR merges clean.