git diff has flags for different angles:
git diff — unstaged changes (working dir vs index).
git diff --staged — staged changes (index vs HEAD). Same as --cached.
git diff HEAD — everything since the last commit (working + staged).
git diff main feature — diff between two refs.
git diff main...feature — three-dot: diff since the merge base. The "what feature added" view.
Summary flags:
--stat — file/lines added/removed per file
--shortstat — one-line totals
--name-only — file names alone
--check — show whitespace problems (great pre-commit)
--word-diff=color highlights word-level changes — invaluable for prose / config.