This specification is inspired by and supersedes the AngularJS commit message format.
We have very precise rules over how our Git commit messages must be formatted. This format leads to easier to read commit history and proper versioning.
Each commit message consists of a header, a body, and a footer.
<header>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
The header
is mandatory and must conform to the Commit Message Header format.
The body
is mandatory for all commits except for those of scope "docs".
When the body is required it must be at least 20 characters long.
The footer
is optional.
Any line of the commit message cannot be longer than 100 characters.
<type>: <short summary>
│ │
│ └─⫸ Summary in present tense. Not capitalized. No period at the end.
│
└─⫸ Commit Type: build|chore|docs|feat|fix|refactor|style|test|update
The <type>
and <summary>
fields are mandatory, the (<scope>)
field is optional.
Must be one of the following:
- build: add required/missing build file
- chore: updating grunt tasks etc; no production code change
- docs: changes to the documentation
- feat: new feature for the user, not a new feature for build script
- fix: bug fix for the user, not a fix to a build script
- refactor: refactoring production code, eg. renaming a variable
- style: formatting, missing semi colons, etc; no production code change
- test: adding missing tests, refactoring tests; no production code change
- update: update an old feature; file;
Use the summary field to provide a succinct description of the change:
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end
Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes".
Explain the motivation for the change in the commit message body. This commit message should explain why you are making the change. You can include a comparison of the previous behavior with the new behavior in order to illustrate the impact of the change.
The footer can contain information about breaking changes and is also the place to reference GitHub issues, Jira tickets, and other PRs that this commit closes or is related to.
BREAKING CHANGE: <breaking change summary>
<BLANK LINE>
<breaking change description + migration instructions>
<BLANK LINE>
<BLANK LINE>
Fixes #<issue number>
Breaking Change section should start with the phrase "BREAKING CHANGE: " followed by a summary of the breaking change, a blank line, and a detailed description of the breaking change that also includes migration instructions.
If the commit reverts a previous commit, it should begin with revert:
, followed by the header of the reverted commit.
The content of the commit message body should contain:
- information about the SHA of the commit being reverted in the following format:
This reverts commit <SHA>
, - a clear description of the reason for reverting the commit message.