Adopt a structured approach to commit messages using the Conventional Commits Specification and the extended rules below. This format enhances clarity, collaboration and automation.
This is the detailed and complete commit message format. It includes:
- Gitmoji: Emojis to visually represent the type of change.
- Breaking Changes: Indicate major updates or backward-incompatible changes.
- Footers: Metadata for tracking.
<gitmoji> <type>(<scope>): <subject> <meta>
<body>
BREAKING CHANGE: <breaking-change>
<footer-header>: <footer-value>
<footer-header>: <footer-value>
A simpler commit message for internal or quick documentation purposes. It excludes:
- Gitmoji
- Footers
- Breaking Changes
<type>(<scope>): <subject> <meta>
<body>
- Indicates the purpose or nature of the overall change
- If there is multiple changes, will be selected based on type of change ranked highest.
- Check below Gitmoji List for gitmoji related keywords
- Only use code. Like,
:art:
,:rocket:
, ....
- Indicates the purpose or nature of the change.
- Must be one of the following:
feat
: New feature.fix
: Bug fix.docs
: Documentation updates.style
: Code style changes.refactor
: Refactoring code.perf
: Performance improvements.test
: Adding or modifying tests.build
: Changes to build system or dependencies.ci
: CI/CD pipeline changes.chore
: Routine tasks or maintenance.revert
: Reverting a previous commit.
- Follows kebab case
- Specifies the affected area of the codebase
- If multiple areas detected, try to make a short slug that overall indicates the scope
- Examples:
auth
,dashboard
,api
,frontend
,backend
- A concise summary of the change
- Try to keep within 50 characters, max cap 72 characters
- Don't end with period
- Must be sentence case
- Written in the imperative mood (e.g., Fix, not Fixed / Fixes etc.). Example:
Good Bad Very Bad Refactor subsystem X for readability Fixed bug with Y More fixes for broken stuff Update getting started documentation Changing behavior of X Sweet new API methods Remove deprecated methods 42 Release version 1.0.0 - Standard terminology
First Word Meaning Add Create a capability e.g. feature, test, dependency. Cut Remove a capability e.g. feature, test, dependency. Fix Fix an issue e.g. bug, typo, accident, misstatement. Bump Increase the version of something e.g. dependency. Make Change the build process, or tooling, or infra. Start Begin doing something; e.g. create a feature flag. Stop End doing something; e.g. remove a feature flag. Refactor A code change that MUST be just a refactoring. Reformat Refactor of formatting, e.g. omit whitespace. Optimize Refactor of performance, e.g. speed up code. Document Refactor of documentation, e.g. help files. - Subject lines must never contain (and / or start with) anything else. Especially not something that's unique to your
system, like
- [bug] ...
- (release) ...
- #12345 ...
- jira://...
- docs: ...
- Must be able to complete the sentence:
If applied, this commit will ...
- Must be wrapped at 72 columns
- Provides additional context or details about the change
- Must only contain explanations as to what and why, never how
- Explain the Background and Reasoning, not the Implementation
- Use bullet points with hyphens or asterisks, followed by a single space, and apply hanging indents
- Each item of the list must be postfixed with relevant Gitmoji
- Optional metadata for tracking and references.
- Common keywords (detect based on content difference/changes/differences):
Author
: Specifies the original author of the commit. (Example:Author: John Doe <[email protected]>
)Acked-by
: Indicates that the person acknowledges and approves the change but may not have directly reviewed it. (Example:Acked-by: Jane Smith <[email protected]>
)Co-authored-by
: Used to credit multiple contributors to a commit. Each co-author gets a line. (Example:Co-authored-by: Alice Brown <[email protected]>
)Closes
: Indicates that the commit resolves or closes a specific issue or bug from a tracker. (Example:Closes: #1234
)Implements
: Shows that this commit implements a specific feature or functionality described in an issue or design document. (Example:Implements: #5678
)Reviewed-by
: Notes the reviewer(s) who reviewed the changes. Often used in projects with formal review processes. (Example:Reviewed-by: Mark Lee <[email protected]>
)Refs
: Refers to related issues, bugs, or other references without necessarily closing or resolving them. ( Example:Refs: #4321
)Signed-off-by
: Certifies that the contributor agrees to the Developer Certificate of Origin (DCO). Common in open source projects. (Example:Signed-off-by: Emily White <[email protected]>
)Tested-by
: Indicates that the changes were tested by someone, ensuring functionality or stability. (Example:Tested-by: Tom Green <[email protected]>
)Fixes
: Indicates that the commit fixes a particular issue or bug. Often used interchangeably withCloses
.
(Example:Fixes: #5432
)See
: Points to related discussions, issues, or resources without directly linking them to the commit.
(Example:See: #1357
)Reported-by
: Credits the person who reported an issue or bug.
(Example:Reported-by: Sam Wilson <[email protected]>
)Suggested-by
: Credits someone who suggested the change or feature.
(Example:Suggested-by: Chris Taylor <[email protected]>
)Part-of
: Indicates that the commit is part of a larger task, feature, or epic.
(Example:Part-of: #2468
)Depends-on
: Specifies that the commit depends on another commit or PR to function correctly.
(Example:Depends-on: #369
)Changelog
: Adds specific notes to be included in a changelog.
(Example:Changelog: Improved performance of search feature.
)
- Use
BREAKING CHANGE:
to signal backward-incompatible changes. - Clearly describe the impact and necessary migration steps.
- Only appliable if there is any breaking changes in code
- An optional meta tag field to indicate the commit's status
- Example Tags: #wip (work in progress) or #irrelevant .....
β¨ feat(dashboard): implement drill-down functionality
- Refactor subsystem X for readability π¨
- Add a new feature for user authentication β¨
- Update the README documentation π
- Remove unused files and dependencies π₯
BREAKING CHANGE: The data format for drill-down events has been changed.
Refs: #1234
feat(dashboard): implement drill-down functionality
- Refactor subsystem X for readability
- Add a new feature for user authentication
- Update the README documentation
- Remove unused files and dependencies
Below is a comprehensive table of Gitmoji emojis, their codes, and descriptions:
Emoji | Code | Description |
---|---|---|
π¨ | :art: |
Improve structure/format of the code. |
β‘οΈ | :zap: |
Improve performance. |
π₯ | :fire: |
Remove code or files. |
π | :bug: |
Fix a bug. |
ποΈ | :ambulance: |
Critical hotfix. |
β¨ | :sparkles: |
Introduce new features. |
π | :memo: |
Add or update documentation. |
π | :rocket: |
Deploy stuff. |
π | :lipstick: |
Add or update the UI and style files. |
π | :tada: |
Begin a project. |
β | :white_check_mark: |
Add, update, or pass tests. |
ποΈ | :lock: |
Fix security or privacy issues. |
π | :closed_lock_with_key: |
Add or update secrets. |
π | :bookmark: |
Release/version tags. |
π¨ | :rotating_light: |
Fix compiler/linter warnings. |
π§ | :construction: |
Work in progress. |
π | :green_heart: |
Fix CI build. |
β¬οΈ | :arrow_down: |
Downgrade dependencies. |
β¬οΈ | :arrow_up: |
Upgrade dependencies. |
π | :pushpin: |
Pin dependencies to specific versions. |
π· | :construction_worker: |
Add or update CI build system. |
π | :chart_with_upwards_trend: |
Add or update analytics or track code. |
β»οΈ | :recycle: |
Refactor code. |
β | :heavy_plus_sign: |
Add a dependency. |
β | :heavy_minus_sign: |
Remove a dependency. |
π§ | :wrench: |
Add or update configuration files. |
π¨ | :hammer: |
Add or update development scripts. |
π | :globe_with_meridians: |
Internationalization and localization. |
βοΈ | :pencil2: |
Fix typos. |
π© | :poop: |
Write bad code that needs to be improved. |
βͺοΈ | :rewind: |
Revert changes. |
π | :twisted_rightwards_arrows: |
Merge branches. |
π¦οΈ | :package: |
Add or update compiled files or packages. |
π½οΈ | :alien: |
Update code due to external API changes. |
π | :truck: |
Move or rename resources (e.g., files, paths, routes). |
π | :page_facing_up: |
Add or update license. |
π₯ | :boom: |
Introduce breaking changes. |
π± | :bento: |
Add or update assets. |
βΏοΈ | :wheelchair: |
Improve accessibility. |
π‘ | :bulb: |
Add or update comments in source code. |
π» | :beers: |
Write code drunkenly. |
π¬ | :speech_balloon: |
Add or update text and literals. |
ποΈ | :card_file_box: |
Perform database-related changes. |
π | :loud_sound: |
Add or update logs. |
π | :mute: |
Remove logs. |
π₯ | :busts_in_silhouette: |
Add or update contributor(s). |
πΈ | :children_crossing: |
Improve user experience/usability. |
ποΈ | :building_construction: |
Make architectural changes. |
π± | :iphone: |
Work on responsive design. |
π€‘ | :clown_face: |
Mock things. |
π₯ | :egg: |
Add or update an easter egg. |
π | :see_no_evil: |
Add or update a .gitignore file. |
πΈ | :camera_flash: |
Add or update snapshots. |
βοΈ | :alembic: |
Perform experiments. |
ποΈ | :mag: |
Improve SEO. |
π·οΈ | :label: |
Add or update types. |
π± | :seedling: |
Add or update seed files. |
π© | :triangular_flag_on_post: |
Add, update, or remove feature flags. |
π₯ | :goal_net: |
Catch errors. |
π« | :dizzy: |
Add or update animations and transitions. |
ποΈ | :wastebasket: |
Deprecate code that needs to be cleaned up. |
π | :passport_control: |
Work on code related to authorization, roles, and permissions. |
π©Ή | :adhesive_bandage: |
Simple fix for a non-critical issue. |
π§ | :monocle_face: |
Data exploration/inspection. |
β°οΈ | :coffin: |
Remove dead code. |
π§ͺ | :test_tube: |
Add a failing test. |
π | :necktie: |
Add or update business logic. |
π©Ί | :stethoscope: |
Add or update healthcheck. |
𧱠| :bricks: |
Infrastructure-related changes. |
π§βπ» | :technologist: |
Improve developer experience. |
πΈ | :money_with_wings: |
Add sponsorships or money-related infrastructure. |
𧡠| :thread: |
Add or update code related to multithreading or concurrency. |
- Generate a diff file (e.g. diff.txt) using
git diff
- Review Commit Message & ensure proper formatting
- Validate Message Structure
- Ensure clarity, consistency, and adherence to guidelines.