DEV Community

Josh Branchaud
Josh Branchaud

Posted on

2 1

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.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (2)

Collapse
 
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.

Collapse
 
jbranchaud profile image
Josh Branchaud

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

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay