Teams should agree on commit message conventions:
- Style: How does the team want to handle markup syntax, wrapping margins, grammar, capitalization and punctuation. This aids in consistency.
- Content: What should your commit message contain or not contain?
- Metadata: Do you want to have Tracking IDs, pull requests numbers, perhaps milestone references or waffle.io issue references?
http://chris.beams.io/posts/git-commit/ 's 7 rules of a great commit message:
- Separate subject from body with a blank line
- Limit the subject line to 50 or less characters
- Capitalize the subject line
- Dont end the subject line with a period
- Use the imperative mood in the subject line 5.1 A properly formed git commit subject line should always be able to complete the following sentence: "If applied, this commit will #{your subject line here}"
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
This site also says it may be better to use something other than the -m "message" addition to the command line, so that you can add stylistic elements suh as a body or paragraphs to the commit. This could be done with an editor instead.
https://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message 's 5 rules:
- 50 character or less subject line
- Add this line: autocmd Filetype gitcommit setlocal spell textwidth=72 To your ~/.vimrc to add spell checking and automatic wrapping (I think this would only apply to the Vim editor, not sure)
- Never use -m on a git commit command line entry.
- Answer the questions:
- Why is this change necessary?
- How does it address the issue?
- What side effects does this change have?
- Link to issue/story/cards in your commit message.