DEV Community

Josh Branchaud
Josh Branchaud

Posted on

Good Commit Messages

There has been a lot written about how to write good commit messages. There are rules, tools, and syntactic considerations.

"I think the best practices for commit message formatting is one of the little details that makes Git great."
-Tim Pope, A Note about Git Commit Messages

"The contributors to these repositories know that a well-crafted Git commit message is the best way to communicate context about a change to fellow developers (and indeed to their future selves)."
-Chris Beams, How to Write a Git Commit Message

"The most important part of a commit message is that it should be clear and meaningful. In the long run, writing good commit messages shows how much of a collaborator you are."
-Bolaji Ayodeji, How to Write Good Commit Messages: A Practical Git Guide

"If it seems difficult to summarize what your commit does, it may be because it includes several logical changes or bug fixes, and are better split up into several commits using git add -p."
-Erlang/OTP, Writing good commit messages

"Getting in the habit of creating quality commit messages makes using and collaborating with Git a lot easier."
-Git Book, Distributed Git - Contributing to a Project

"Commitizen is an open source project that helps contributors be good open source citizens."
-Commitizen, a CLI tool to help you generate commit messages

"A diff will tell you what changed, but only the commit message can properly tell you why."
-Chris Beams, How to Write a Git Commit Message

At the end of the day, the biggest thing is: are your commit messages an extension of your teams communication. Do they help convey understanding at this moment as well as in the code review process and will they provide guidance in a future code investigation.

Top comments (2)

jessekphillips profile image
Jesse Phillips

My take on it is that rebase is a critical in building that meaningful commit message. I tried to build up to it.

jbranchaud profile image
Josh Branchaud

Absolutely! I tried to touch on that a bit in this Cleanup Commits post.