DATA 201 · Day 3 · Tue 9/8/2026

Collision Course

Your first merge conflict, on purpose — so the first one that happens by accident, maybe during Exam 1, isn't a surprise.

⏲ ~20 min, start of class

WhyNobody's first conflict should be during an exam

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

01Set up the collision

Pair up with one teammate. You'll both edit the exact same line of the exact same file, on purpose.

Partner A

  1. git checkout -b conflict-drill-a
  2. Open (or create) scratch/conflict_practice.md
  3. Edit the line that says FAVORITE PLOT: ___ — fill in your answer
  4. git add . && git commit -m "A: favorite plot"
  5. git push origin conflict-drill-a

Partner B

  1. git checkout -b conflict-drill-b
  2. Open the same file, same starting point
  3. Edit the same line with a different answer
  4. git add . && git commit -m "B: favorite plot"
  5. git push origin conflict-drill-b

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

02Read the wreckage

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.

03Resolve it together

Decide
Talk it out. Keep one answer, keep both, or write a new one — your call as a pair.
Edit
Delete all three marker lines (<<<<<<<, =======, >>>>>>>) and leave only the final text.
Save & stage
git add scratch/conflict_practice.md
Commit the merge
git commit -m "resolve favorite-plot conflict"
Push & merge
git push origin conflict-drill-b, then the PR merges clean.

Debrief (whole class, ~5 min)