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 diffgit 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 --stagedUseful 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.