Open any project’s git log and you’ll probably see it:
fix bug update stuff final changes WIP
It’s chaos. It’s useless. And when you come back six months later, it’s like trying to reconstruct history with broken fortune cookies.
Good commit messages aren’t just “nice to have.” They’re the difference between a project that tells a clear story and one that feels like ancient ruins. Here’s how to stop writing garbage commit messages and start writing ones that future-you (and your teammates) will actually thank you for.
Why Commit Messages Matter
Debugging faster: When a bug appears, you can trace the exact commit that caused it. If the message is “stuff fixed,” that’s not helpful.
Onboarding teammates: New devs can skim history to learn how the code evolved.
Code reviews: A precise message explains the why without forcing reviewers to reverse-engineer intent.
Future you: You won’t remember what “WIP” meant in three months. Spoiler: you’ll regret it.
The Anatomy of a Good Commit Message
Think of a commit message as a tweet to your future self. Clear, direct, and a little disciplined. A simple structure works best:
Short summary (50 chars or less)
Written in imperative mood (“Fix bug,” not “Fixed bug”).
Explains what changed.
Example:
Add validation for user email formatOptional body (wrapped at 72 chars)
Explains why the change was needed.
Adds context that isn’t obvious from the code diff.
Example:
Add validation for user email format Prevents invalid entries from breaking downstream processes.
Common Commit Message Crimes
If you’ve written any of these, you’re guilty (don’t worry, we all are):
“Fix bug” — Which bug? Where?
“Update” — Update what?
“Final changes” — Spoiler: it’s never final.
“WIP” — A confession that you don’t know what’s happening.
Every one of these is a breadcrumb trail to nowhere.
A Simple Template to Follow
Here’s a dead-simple formula:
<type>: <short summary> <optional longer explanation>
Types could be:
feat:new featurefix:bug fixdocs:documentation onlyrefactor:code restructure, no behavior changetest:adding or fixing tests
Example:
fix: handle null pointer in user auth Null values caused login service to crash in rare cases. Added a default guard to prevent runtime error.
This format is clean, consistent, and easy to parse with tools like Conventional Commits.
Pro Tips and Hacks
Use Git hooks to enforce commit message length and style.
Adopt Conventional Commits if you want auto-generated changelogs.
Write like you’re explaining to a teammate, not a robot.
Keep commits small — a clear commit message can’t rescue a giant, messy diff.
Bottom Line
Commit messages are developer time capsules. Bad ones waste hours, good ones save them. Next time you type git commit -m "stuff", remember: you’re either building a readable history… or future-you’s nightmare.