How to Write Awful Commit Messages

And how to write good ones too

Tyler Hawkins
Level Up Coding
Published in
3 min readMar 8, 2021

--

Photo by Chandler Cruttenden on Unsplash

When is the last time you’ve looked through your repo’s git history? Go ahead and do it right now using git log. What do you see? Meaningful commit messages? Or a tangled mess of unhelpful statements?

Code is read more frequently than it is written, and the same is true of commit messages. Engineers working on legacy code will rely on the commit messages from previous developers to gain much needed context on why the code was written the way it was.

Therefore, make your commit messages good.

In this article we’ll learn how to write good commit messages by examining the exact opposite — truly terrible commit messages.

The Vague Commit Message

fixing some stuff

Cool. So… what stuff were you fixing? Why were you fixing it? What problem were you trying to solve? What approach did you end up taking, and why?

I have no idea.

The Code Review Feedback Commit Message

changes based on code review feedback

Ok. So I know these were some requested changes, and they must be related to earlier changes on this same merge request. But, like our last…

--

--