Commit your changes when you are happy with them. But remember that a commit should only contain changes relevant to its message.
Summarize changes in around 50 characters or fewer.
More detailed explanatory text, if necessary, will be put on the body. Wrap it to about 72 characters or so, max 80.
The first line is treated as the title of the commit and the rest of the text as the body.
The blank line separating the summary from the body is critical (unless you omit
the body entirely); various tools like log, shortlog and rebase can get
confused if you run the two together.
The commit title must complete the phrase "If applied, this commit will β¦β", like this:
-
If applied, this commit will Refactor subsystem X for readability
-
If applied, this commit will Update getting started documentation
-
If applied, this commit will Remove deprecated methods
-
If applied, this commit will Release version 1.0.0
-
If applied, this commit will Merge pull request #123 from user/branch
Explain the problem that this commit is solving. Focus on why you are making this change as opposed to how (the code explains that). Are there side effects or other unintuitive consequences of this change? Hereβs the place to explain them.
Paragraphs will come after blank lines.
Bullet points are okay, too. Use an asterisk, preceded by a single space, with blank lines in between in case your items exceeds 80 chars.
Put references to the issue tracker at the bottom, like this:
Fix #123 See also #456, #789
Always follow these rules:
-
Use the present tense ("Add feature" not "Added feature")
-
Use the imperative mood ("Move cursor toβ¦β" not "Moves cursor toβ¦β")
-
Limit the first line to 72 characters or fewer
-
Reference issues and pull requests liberally after the first line
-
Capitalize when possible following grammar rules
-
Do not end the title line with a period
-
Do not assume everyone understands what the original problem was, ensure you add it
-
Do not think your code is self-explanatory
-
Start the commit message with the corresponding emoji (gitmoji):
| Emoji | Unicode Name | Usage |
|---|---|---|
π¨ |
|
Improve structure / format of the code. |
β‘ |
|
Improve performance. |
π₯ |
|
Remove code or files. |
π |
|
Fix a bug. |
π |
|
Critical hotfix. |
β¨ |
|
Introduce new features. |
π |
|
Add or update documentation. |
π |
|
Deploy stuff. |
π |
|
Add or update the UI and style files. |
π |
|
Begin a project. |
β |
|
Add, update or pass tests. |
π |
|
Fix security issues. |
π |
|
Add or update secrets. |
π |
|
Release / Version tags. |
π¨ |
|
Fix compiler / linter warnings. |
π§ |
|
Work in progress. |
π |
|
Fix CI build. |
β¬οΈ |
|
Downgrade dependencies. |
β¬οΈ |
|
Upgrade dependencies. |
π |
|
Pin dependencies to specific versions. |
π· |
|
Add or update CI build system. |
π |
|
Add or update analytics or track code. |
β» |
|
Refactor code. |
β |
|
Add a dependency. |
β |
|
Remove a dependency. |
π§ |
|
Add or update configuration files. |
π¨ |
|
Add or update development scripts. |
π |
|
Internationalization and localization. |
β |
|
Fix typos. |
π© |
|
Write bad code that needs to be improved. |
βͺ |
|
Revert changes. |
π |
|
Merge branches. |
π¦ |
|
Add or update compiled files or packages. |
π½ |
|
Update code due to external API changes. |
π |
|
Move or rename resources (e.g.: files, paths, routes). |
π |
|
Add or update license. |
π₯ |
|
Introduce breaking changes. |
π± |
|
Add or update assets. |
βΏ |
|
Improve accessibility. |
π‘ |
|
Add or updates comments in source code. |
π |
|
Perform database related changes. |
π |
|
Add or update logs. |
π |
|
Remove logs. |
π₯ |
|
Add or update contributors. |
πΈ |
|
Improve user experience / usability. |
π |
|
Make architectural changes. |
π± |
|
Work on responsive design. |
π€‘ |
|
Mock things. |
π₯ |
|
Add or update an Easter Egg. |
π |
|
Add or update a |
πΈ |
|
Add or update snapshots. |
β |
|
Perform experiments. |
π |
|
Improve SEO. |
π· |
|
Add or update types. |
π± |
|
Add or update seed files. |
π© |
|
Add, update or remove feature flags. |
π₯ |
|
Catch errors. |
π« |
|
Add or update animations and transitions. |
π |
|
Deprecate code that needs to be cleaned up. |
π |
|
Work on code related to authorization, roles and permissions. |
π©Ή |
|
Simple fix for a non-critical issue. |
π§ |
|
Data exploration / inspection. |
β° |
|
Remove dead code. |
π§ͺ |
|
Add a failing test. |
π |
|
Add or update business logic. |
π©Ί |
|
Add or update health check. |
π§± |
|
Infrastructure related changes. |