Write commit messages that explain WHY a change was made, not just WHAT changed. "fix bug" tells future-you nothing — "fix: prevent duplicate form submission on slow connections" tells you the context, the cause, and the scope without reading any code.
Why This Matters
Poor commit messages make git log, git blame, and git bisect useless for debugging. When a regression appears and every commit says "fix bug" or "update code", developers must read every diff to understand what changed and why — turning a 10-minute bisect into a multi-hour archaeology session.
Git history is your codebase's memory. When a production bug appears six months from now, the first tool you reach for is git log and git blame. The commit message is the difference between "fix: prevent duplicate form submission when server responds slowly (closes #847)" — which tells you exactly what, why, and where to look — and "fix bug" — which tells you nothing.
Descriptive commit messages also make git bisect effective. When bisecting a regression across 200 commits, meaningful messages let you skip obviously irrelevant commits and focus on likely candidates. With "update" and "fix" messages, every commit is equally suspect.
This investment is trivial: 30 extra seconds per commit saves hours of debugging later.
The rule
Every commit message should follow the format: type: description that explains the why. Use conventional commit types (feat, fix, refactor, docs, test, chore). The description should explain the motivation, not just restate the diff.
Bad example
fix bugupdate codewipfinal fixplease workchanges
Good example
fix: prevent duplicate form submission on slow connectionsThe submit button remained active while waiting for the serverresponse. On connections >2s latency, users would click again,creating duplicate records. Disable the button on submit andshow a loading spinner.Closes #847
feat: add CSV export for transaction historyUsers requested the ability to export transactions for theiraccountants. Adds a "Download CSV" button on the transactionspage that exports the current filtered view.Closes #1203
How to detect
Review recent commit messages:
git log --oneline -20
Look for messages that are:
Under 10 characters
Generic ("fix", "update", "changes", "wip")
Missing context about why the change was made
Remediation
Adopt a conventional commit format: type(scope): description
Use the commit body for additional context (separate from subject with a blank line)
Reference issue numbers with Closes #123 or Fixes #456
Set up a commit-msg hook with commitlint to enforce the format
When reviewing PRs, check commit messages as part of the review — send back vague messages