One-page cheatsheet for Clean Commit workflow
<emoji> <type>: <description>
<emoji> <type> (<scope>): <description> [with optional scope]
<emoji> <type>!: <description> [with breaking change marker]
<emoji> <type>! (<scope>): <description> [with scope and breaking change marker]
| Emoji | Type | Use For |
|---|---|---|
| 📦 | new |
Adding code, features, files |
| 🔧 | update |
Changing existing code, refactoring |
| 🗑️ | remove |
Removing code, files, features |
| 🔒 | security |
Security fixes, patches, vulnerabilities |
| ⚙️ | setup |
Project configs, CI/CD, tooling |
| ☕ | chore |
Maintenance, dependencies, housekeeping |
| 🧪 | test |
Test changes and additions |
| 📖 | docs |
Documentation updates |
| 🚀 | release |
Version releases |
Releasing a version? → 🚀 release
Security fix? → 🔒 security
Only docs? → 📖 docs
Only tests? → 🧪 test
Config/CI/tooling? → ⚙️ setup
Removing something? → 🗑️ remove
Adding new functionality? → 📦 new
Changing existing code? → 🔧 update
Maintenance/cleanup? → ☕ chore
📦 new: user authentication system
📦 new (api): endpoint for user registration
📦 new: dark mode support
🔧 update: improve database query performance
🔧 update (ui): enhance button animations
🔧 update: refactor payment processing
🗑️ remove: deprecated api endpoints
🗑️ remove (deps): unused lodash dependency
🗑️ remove: obsolete migration scripts
🔒 security: patch xss vulnerability
🔒 security (auth): fix jwt validation
🔒 security: update dependencies with cves
⚙️ setup: add eslint configuration
⚙️ setup (ci): configure github actions
⚙️ setup: initialize docker environment
☕ chore: update npm dependencies
☕ chore (deps): bump react to v18
☕ chore: clean up unused imports
🧪 test: add unit tests for auth service
🧪 test (api): integration tests for users
🧪 test: fix flaky date parsing test
📖 docs: update installation guide
📖 docs (api): add endpoint documentation
📖 docs: fix typos in readme
🚀 release: version 1.0.0
🚀 release: prepare for v2.1.0
🚀 release: hotfix version 1.0.1
- ✅ Emoji matches the type
- ✅ Type is lowercase
- ✅
!immediately after type (no space) if breaking change — only fornew,update,remove,security - ✅ Space after colon
- ✅ Present tense description
- ✅ Lowercase first letter of description
- ✅ No period at end
- ✅ Under 72 characters total
Use ! immediately after the type to signal a breaking change in the subject line. Only valid for new, update, remove, and security types:
📦 new!: completely redesign authentication system
🔧 update!: drop support for node 14
🗑️ remove!: remove deprecated v1 api endpoints
🔒 security!: enforce tls 1.2 minimum across all connections
🔧 update! (api): change response format for all endpoints
Optionally add BREAKING CHANGE: in the commit body for more detail:
🔧 update! (api): change authentication endpoint response format
BREAKING CHANGE: Authentication endpoint now returns user object instead of token string.
Optional but useful for larger projects
Good scopes:
- Component:
(header),(footer),(navbar) - Module:
(api),(database),(auth) - Feature:
(payments),(notifications)
Keep scopes:
- Short (prefer one word)
- Lowercase
- Consistent across project
Create a .gitmessage file in your project:
# <emoji> <type> (<scope>): <description>
#
# Types:
# 📦 new - Adding code
# 🔧 update - Changing code
# 🗑️ remove - Removing code
# 🔒 security - Security fixes
# ⚙️ setup - Project configs
# ☕ chore - Maintenance
# 🧪 test - Tests
# 📖 docs - Documentation
# 🚀 release - Version releases
#
# Rules:
# - Use present tense
# - Lowercase type and description
# - No period at end
# - Max 72 chars
#
# Example: 📦 new (auth): user login with email verification
git config --global commit.template ~/.gitmessagegit config commit.template .gitmessage☕ chore (deps): bump express from 4.17.1 to 4.18.2
☕ chore: update all dev dependencies
🔒 security: update lodash to fix vulnerability
🔧 update: refactor user service to use async/await
🔧 update (api): simplify error handling middleware
🔧 update: extract validation logic to utils
📦 new: real-time notifications with websockets
📦 new (api): pagination support for all endpoints
📦 new: export data to csv functionality
🔧 update: fix date formatting in profile
🔧 update (api): handle null values in response
🔒 security: fix auth token validation bypass
🧪 test: add e2e tests for checkout flow
🧪 test (unit): increase coverage for utils
🧪 test: mock external api in integration tests
-
One commit = One logical change
- Don't mix types in one commit
- Split unrelated changes
-
Write for humans
- Be clear and descriptive
- Think: "What did this commit accomplish?"
-
Be consistent
- Stick to the workflow
- Use the same scope names
-
When in doubt, check the decision tree
- Start from top (release? security?)
- Work your way down
Clean Code deserves Clean Commit.