🔎 CHAPTER 2 · GIT DIFF
Chef You

Spot the
Difference

Before you commit, you want to see exactly what changed. git diff is your magnifying glass — it highlights every line added, removed, or modified.

Scene I

Green lines and red lines

Chef You

git diff shows you a line-by-line comparison between the old and new versions of your files.

+ Green lines are additions — new stuff.
- Red lines are deletions — removed stuff.
White lines are unchanged context.

Can you read the diff and spot what changed?

🔎 DIFF CHALLENGE Round 1 / 3
📄 OLD VERSION (before)
📄 NEW VERSION (after)
Expert!

🎉 You can read diffs!

You've learned to spot the differences in code. Red lines are gone, green lines are new — it's that simple.

Always read the diff before you commit. It's your last chance to catch mistakes.

$ git diff
diff --git a/recipe.md b/recipe.md
- Preheat to 180°C
+ Preheat to 190°C
$ git diff --staged
# Shows changes already added to staging
Epilogue
Green is added.
Red is removed.
Diff is your magnifying glass.

Review your diffs before every commit. It takes 10 seconds and saves you from committing debugging prints and typos.