Module 2: Everyday Local Workflow

Reading Status and Diffs

Reading status and diffs

Before saving work, inspect it. This habit prevents accidental commits, debug prints, generated files, and unrelated edits from entering history.

git status
git diff

git status tells you which files changed. git diff shows unstaged line-level changes. After staging a file, use git diff --staged to inspect what will go into the next commit.

git add README.md
git diff --staged

Useful diff options

  • git diff --stat gives a short file summary.
  • git diff --word-diff helps with prose changes.
  • git diff HEAD compares the working tree and index against the latest commit.

Make inspection automatic: edit, test, status, diff, stage, diff staged, commit. This is slower for the first week and much faster for the rest of your career.