Process
- Run
git statusto see all changed files. Read the output carefully. - Run
git diff --statto understand the scope of the change. - Group related changes. If the diff contains unrelated changes (e.g., a bug fix AND a new feature), create separate commits. Do not bundle unrelated work.
- Stage files intentionally. Use
git add <specific-files>, nevergit add .unless every changed file belongs in the same logical commit. - Write the commit message using Conventional Commits format:
Types:<type>(<scope>): <description> <body — explain WHY, not WHAT> <footer — references, breaking changes>feat,fix,refactor,docs,test,chore,perf,ci - Verify before committing. Run
git diff --cachedto review exactly what will be committed. Read the staged diff. - Commit. Run
git commit -m "..."with the message.
Rationalizations
| Excuse | Rebuttal |
|---|---|
"I'll just use git add . to save time" |
Staging everything blindly leads to committing debug files, env vars, and unrelated changes. Stage intentionally. |
| "The message 'fix stuff' is fine for now" | Every commit message is permanent history. Write it properly the first time. |
| "I'll squash these later" | You won't. Write clean commits now. |
Verification
-
git diff --cachedoutput was reviewed before committing - Commit message follows Conventional Commits format
- No unrelated changes were bundled into a single commit
- No
.env,__pycache__, or build artifacts were staged