Skip to content

Instantly share code, notes, and snippets.

@rasheedamir
Created February 11, 2015 13:25
Show Gist options
  • Select an option

  • Save rasheedamir/1aec468cf93b07e4cf69 to your computer and use it in GitHub Desktop.

Select an option

Save rasheedamir/1aec468cf93b07e4cf69 to your computer and use it in GitHub Desktop.
Git Commit Guidelines

Git Commit Guidelines

We have rules over how our git commit messages must be formatted.

Commit Message Format

Each commit message consists of a header, a body and a footer.

<header>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on Github as well as in various git tools.

Header

The Header contains a succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize first letter
  • no dot (.) at the end

###Body If your change is simple, the Body is optional.

Just as in the Header, use the imperative, present tense: "change" not "changed" nor "changes". The Body should include the motivation for the change and contrast this with previous behavior.

###Footer The footer is the place to reference GitHub issues that this commit Closes.

You must use the Github keywords for automatically closing the issues referenced in your commit.

Example

For example, here is a good commit message:

upgrade to Spring Boot 1.1.7

upgraded the Maven and Gradle builds to use the new Spring Boot 1.1.7,
see http://spring.io/blog/2014/09/26/spring-boot-1-1-7-released

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