Good Code
The good version inspects the unstaged diff, stages only relevant hunks, then reviews the staged diff before committing.
Lesson 02
Stage changes deliberately so each commit contains only the hunks that belong together.
# Inspect first, then stage only related hunks.
git diff
git add -p src/review.ts
git diff --staged
git commit -m "fix review navigation labels"# This stages unrelated edits, generated files, and debug changes.
git add .
git commit -m "fix stuff"
git pushThe good version inspects the unstaged diff, stages only relevant hunks, then reviews the staged diff before committing.
The bad version adds unrelated files and gives reviewers no signal about the intent of the change.