Skip to content

Instantly share code, notes, and snippets.

@jeneve
Created April 14, 2016 15:44
Show Gist options
  • Save jeneve/e4c9a072e9b542b18f3ca46382669ed8 to your computer and use it in GitHub Desktop.
Save jeneve/e4c9a072e9b542b18f3ca46382669ed8 to your computer and use it in GitHub Desktop.

#commit messages

source: this post

there are more ways to make a commit message than with -m, which typically is used for one liners. you can even have it read from a separate file.

well-crafted git commit message is the best way to communicate context about a change to fellow developers (and indeed to their future selves). A diff will tell you what changed, but only the commit message can properly tell you why.

In order to create a useful revision history, teams should first agree on a commit message convention that defines at least the following three things:

Style. Markup syntax, wrap margins, grammar, capitalization, punctuation. Spell these things out, remove the guesswork, and make it all as simple as possible. The end result will be a remarkably consistent log that's not only a pleasure to read but that actually does get read on a regular basis.

Content. What kind of information should the body of the commit message (if any) contain? What should it not contain?

Metadata. How should issue tracking IDs, pull request numbers, etc. be referenced?

examples of good commit messages that I can understand: pending

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment