DEV Community

Discussion on: A Beginner’s Guide to Git — How to Write a Good Commit Message

Collapse
 
mattmoranjava profile image
Matt Moran

If you specify a text editor in your git config, e.g.
editor = /usr/bin/vim
then you can write your commit messages in a more composed way.
Where I work we follow an in-house rule. The first line of the commit message cannot exceed 80 characters, and must begin with the relevant JIRA ticket reference, followed by a space & a pipe character - e.g.:

LRA-4628 | Fixed tests that were broken by front-end change

and then if it needs any further explanation you can put, after a blank line, a short paragraph on what was done. The ticket reference should give you all the info you need, but I find if there was something out of the ordinary found during the change I like to document it in the commit message too.