Skip to content

Instantly share code, notes, and snippets.

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

Proper commit messages

Seven rules for commit messages

  • 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 Explanation for these rules can be found here

Use an editor such as vim to write your commit messages, don't use the -m flag in the terminal.

two examples of a good git commit message Linus Torvald on the Linux kernel https://github.com/torvalds/linux/commit/741f37b8ccf10b3f9976f7e55b703af8087f182a

Tute Costa on the paperclip gem https://github.com/thoughtbot/paperclip/commit/0b73776db5812ffd29ba729117b17c36271e1f05

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