We like commits to be clear, concise and easy to review. To achieve this, keep your commits as small and specific as possible.
For a discussion on the importance of good commit messages, please see this article.
When writing commit messages follow these rules:
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move file to..." not "Moves file to...")
- Do not add full stops to the end of the first line of the commit message
- Limit the first line to 72 characters or less, 50 or less is ideal
- More information or explanation may be added after an empty line, however the first line should always adequately summarize the change made
- Do not reference issues/pull requests in commit messages
- The only exception is the automatic reference inserted by GitHub when squashing/merging a pull-request
If you are having trouble writing a succinct commit message, or if it includes the word 'and', consider splitting the commit into smaller ones.
Consider selecting an emoji for each of your commits (based on Atom's emoji styleguide).
Examples:
- π
:bug:- Bug fixes - π
:memo:- Adding docs - π₯
:fire:- Removing code - π¦
:package:- Adding new packages - π
:green_heart:- Fixes CI Build - π¨
:art:- Adding UI components - β
:white_check_mark:Adding or modifying tests - β¨
:sparkles:- Adding a new feature - π§
:construction:- Refactor - π
:lipstick:- Cosmetic changes to code style - π
:triangular_ruler:- Pixel perfect changes to UI
Note that GitHub might use the pull request title as commit message for the squashed commit. In that case, edit the message to include an appropriate emoji before squashing.