DEV Community

Cover image for Authoring commit messages
Andrew Petro
Andrew Petro

Posted on • Edited on

Authoring commit messages

Great writing is intentional. It considers the needs and expectations of the reader.

Commit messages are writing.

Commit messages are great when they're intentional, considerate of the needs and expectations of the reader.

Who's the reader?

The reader is future you. Or future me. It is colleagues reviewing a Pull Request. It's a release engineer trying to verify and summarize the changes that will go into a release. It's someone troubleshooting trying to find when an unexpected change may have been introduced. It's a team member try to catch up on changes to a product.

Write great commit messages.

That automatic message stub that GitLab generates for you? It's not great.

Update Deployment.md

Don't focus on what file you changed. That's apparent from the substance of the commit, from the diff. Rather, focus on the meaning of what you changed and why you changed it.

Better:

Add checklist step to post in Service Operations channel

This post is less about directly telling you how to do this, and more a place where I can collect annotated links about this.

See also: my Pinboard tag commit_messages.

Cover photo credit: Photo by NihoNorway graphy on Unsplash

Top comments (0)