loading...

Good Commit Messages

jbranchaud profile image Josh Branchaud ・2 min read

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.

Posted on by:

jbranchaud profile

Josh Branchaud

@jbranchaud

I'm a developer and consultant focused primarily on the web, specializing in React, Ruby on Rails, and PostgreSQL. Newsletter: https://tinyletter.com/jbranchaud

Discussion

markdown guide
 

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

 

Absolutely! I tried to touch on that a bit in this Cleanup Commits post. dev.to/jbranchaud/cleanup-commits-...