Preventing Conflicts

This block's own real conflicts, reviewed for the patterns that caused them — prevention beats resolution.

Resolving conflicts is a real, necessary skill — but the senior move is noticing the real pattern behind them before they happen again. This block's own two real conflicts (the README/config merge, the rebase conflict) share an honest, specific cause: multiple people editing the exact same narrow status line or setting, repeatedly, on branches that lived just long enough to diverge.\n\nThis lesson reviews the real, actual history — not a hypothetical example — using git show and git log, then reasons through what a real team would change to make this kind of conflict genuinely less likely.

Finding the Real Merge in History

git log --oneline --merges -5

Every real merge commit this project has ever made, most recent first — including the two real conflicts this block resolved.

Reviewing What Actually Happened

git show --stat <merge-commit>

git's own real record includes a "# Conflicts:" note, automatically appended the moment a merge commit resolves an actual conflict — a genuine, built-in audit trail requiring no extra effort to create.

Tracing the Real Repeated Touch Points

git log --oneline README.md | head -5

The exact same file, touched by multiple real, overlapping commits in a short span — the real, specific shape of what caused the conflict.

The Real Pattern, and the Real Fix

Both of this block's conflicts share an honest cause: a narrow, frequently-touched line (a status field, a config setting, a shared list) edited independently on short-lived branches that happened to overlap in time. The real, senior-level fix is not "communicate more" in the abstract — it is a specific, concrete practice: keep shared config/status fields in a single, designated owner's commits, or split them into smaller, less contested files.

The "# Conflicts:" auto-note

git automatically appends a real "# Conflicts:" section listing every file that had a genuine conflict, the moment a merge commit resolving one is created. Confirmed directly in this lab: it appeared in the real config-tweaks merge commit's message with zero extra effort required to record it.

Conflict pattern review

Using real git history (git log --merges, git show, git log <file>) to identify what actually caused a genuine past conflict, rather than guessing. Confirmed directly in this lab: the real repeated touches to README.md's status line were visible directly in its own commit history.

🔍 Find the Real Merge in History

List the project's actual merge commits, most recent first.

cd ~/team-recipes && git switch master
cd ~/team-recipes && git log --oneline --merges -5

student@lab:~$ cd ~/team-recipes && git switch master Switched to branch 'master' Your branch is up to date with 'origin/master'. student@lab:~$ cd ~/team-recipes && git log --oneline --merges -5 f99d1d6 Merge pull request: weekly shopping list 9be19b0 Merge pull request: config tweaks d349a32 Merge pull request: hotfix soup serving typo 67f9971 Merge pull request: spice rack guide 4a2fc3b Merge pull request: fridge organization tips

📋 Review What the Real Merge Actually Recorded

See git's own automatic record of exactly which files genuinely conflicted.

cd ~/team-recipes && git show --stat 9be19b0 | grep -v '^Author:'

student@lab:~$ cd ~/team-recipes && git show --stat 9be19b0 | grep -v '^Author:' commit 9be19b0c46821e204656651f3dd2bfe415e69df4 Merge: 60dea42 9f69af9 Date: Thu Jan 1 14:30:00 2026 +0000 Merge pull request: config tweaks # Conflicts: # README.md # config.json README.md | 2 +- config.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)

🔎 Trace the Real Repeated Touch Points

See how often the exact same file kept getting edited in a short span.

cd ~/team-recipes && git log --oneline README.md | head -5

student@lab:~$ cd ~/team-recipes && git log --oneline README.md | head -5 9be19b0 Merge pull request: config tweaks f92e286 Mark README as published 2668821 Mark README as ready for review e401004 Note WIP status in README ef0ee5c Add project README

Lab 2.4.5 complete — Block 2.4 complete. This block's own real conflicts, reviewed for the pattern behind them:\n\n\n Real merge history reviewed : ✅ git log --merges\n Real conflict record inspected : ✅ git show --stat\n Real repeated touch points traced : ✅ git log <file>\n Real, structural prevention proposed : ✅ judgment applied\n

Enable JavaScript to run the live terminal and track your progress.