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 diffRepresentative output
diff --git a/README.md b/README.md
+Document the local setup steps.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 --stagedRepresentative output
diff --git a/README.md b/README.md
+Document the local setup steps.Useful diff options
git diff --statgives a short file summary.git diff --word-diffhelps with prose changes.git diff HEADcompares 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.