The One Git Commit Habit That Will Save You Hours Later
“Refactor stuff” is not a commit message. It’s a cry for help.
“Refactor stuff” is not a commit message. It’s a cry for help.
You’ve seen it. You’ve done it. We’ve all been there.
You’re knee-deep in a feature, test’s passing, and the final step is…
git commit -m "fix"
Ship it.
And six months later, you or your teammate opens git log and wonders:
What does “fix” even mean?
Fix “what”?

Why Your Commit Messages Matter More Than You Think
Git commit messages aren’t just for today — they’re breadcrumbs for the future.
When:
You’re debugging something that broke last Tuesday
You’re reviewing someone else’s pull request
You’re hunting regressions from code you don’t even remember writing
…a clear commit message can save you hours.
Bad messages? They’re technical debt in disguise.
Here’s What to Do Instead
Use this structure:
<type>: <short summary>
[optional longer description]
[optional links/issues/reasoning
Example:
fix: handle empty search input in search bar
Previously, typing an empty string into the search bar caused a 500 error.
Added a check to skip query if input is empty.
Closes #124.
Simple. Clear. Useful.
You may even drop the “type” if you give a sufficiently descriptive short summary in the message.
Commit Types You Should Use
These prefixes (from Conventional Commits) make logs easier to scan:
feat: — A new feature
fix: — A bug fix
chore: — Maintenance or refactors
docs: — Documentation changes
test: — Adding or updating tests
refactor: — Code change that doesn’t fix a bug or add a feature
Pro Tips That Separate Juniors from Seniors
Commit early, commit often — Small commits = easier reviews.
Explain the “why” — The code shows the what. You write the why.
Write like someone else will read it — because they will.
Bonus: Copy-Paste Commit Message Template
git commit -m "type: short summary" -m "longer explanation" -m "Closes #123"
Or automate with tools like commitizen and commitlint.
Your commit messages don’t need to be poetry. They just need to help your future self and your team.
Bad commits are easy.
Great commits are unforgettable.