Notes and resources for writing good and useful git commit messages

Writing commit messages by Simon Tatham


That’s the first example on the website. What does this commit message actually tell us? It tells us that in the software project at hand, there is a “config object” and that now this object can be used to extend other configs.

Fine.

It does not tell us why this change was made (other than that it is a new feature now) and it does not tell us what was done for this to become possible. It tells us that there is a breaking change, but it does not tell us why there was this breaking change, whom this may concern, why this might be a problem even, or how users should react to this breaking change.

I hate Conventional Commits — musicmatzes blog


  • Separate subject from body with a blank line
  • Limit the subject line to 50 characters
  • Capitalize the subject line
  • Do not end the subject line with a period
  • Use the imperative mood in the subject line
  • Wrap the body at 72 characters
  • Use the body to explain what and why vs. how

How to Write a Git Commit Message


Henrik Jernevad writes about Focused commits 🔍 · Henrik Jernevad and how the difficulty of writing a good commit message may be a result of having too much in one changeset.


Andreas Heigl has a lengthy and well written blog post about writing good commit messages and he provides practical examples: Commit it! » andreas.heigl.org


In No Longer My Favorite Git Commit, Michael Lynch references David Thompson’s great My favourite git commit (that I use as an example in Contemporary Documentation (talk)) and proposes improvements to the original commit message. Michael has also written How to Write Useful Commit Messages.