Skip to content

Instantly share code, notes, and snippets.

@deborahleehamel
Last active February 13, 2018 21:11
Show Gist options
  • Save deborahleehamel/ffa229a001675e1245ba6f1292e56d16 to your computer and use it in GitHub Desktop.
Save deborahleehamel/ffa229a001675e1245ba6f1292e56d16 to your computer and use it in GitHub Desktop.
Proper git commit messages

Proper git messages - Rules and examples

##The seven rules of a great git commit message

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

##Other general advce:

  1. Don't vary wildly in length and form
  2. teams should first agree on a commit message convention that defines style(syntax, grammar, punctuation), content, metadata(issue tracking IDs, pull request numbers) ​

##Examples - Good commit messages:

Commit message example 1
[Make configuration of acceptors and selectors compatible with Jetty 8](https://github.com/spring-projects/spring-boot/commit/69499bf329a5adc17e16dcff8f380e1561767ae2)
Commit message example 2
Support max-http-header-size & max-http-post-size - https://github.com/spring-projects/spring-boot/commit/6d2f88ed9ba196ed04ecfcc0cc10cbcb267f155f
Commit message example 3
Add tests for ImportSelector meta-data
Commit message example 4
Update docbook dependency and generate epub
Commit message example 5
Fix failing CompositePropertySourceTest
Commit message example 6
Rework @PropertySource early parsing logic

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