We encourage a commit convention style utilized by the Linux kernel. Unlike semantic commit messages, we only focus on the summary of the changes.
- Subject is limited to 50 characters.
- Subject should capitalize the first letter.
- Subject should not have a period or any other punctuation marks after the end.
- Commits should be in imperative tone.
- Structure messages in 2W1H format (What, Why, How), if applicable.
This keeps the initial summary concise, details should be reserved in the second Git commit line message. The only exceptions here are Git messages that are generated by default.
Commits are now required to follow some English syntax queues, preferrably now the subject line is now encouraged to be capitalized at the first letter.
In accordance to the subject character limit rule, punctuation marks at the end of the subject line is now illegal.
Imperative is defined as "of vital importance" or "in command", commits should always remain in imperative tone since this is also the default tone used in Git default messages.
Adapted from the Linux kernel, the 2W1H format structures the messages on three main points
- What: what is the specific problem we're trying to solve?
- Why: why should it be solved, what impact does it have for the end user?
- How: explain how your solution would work.
This is entirely optional, but encouraged, since it presents a rather good structure when explaining complex commits.
- Chris Beam's How to Write a Git Commit Message
- Petter Hutterer's On Commit Messages