If you are looking to create your own GitHub project or contribute to an existing one, understanding commit naming conventions is essential.
Use a consistent format
Maintaining a consistent commit message format improves readability and collaboration.
Standard format:
<type>(<scope>): <description>
<type>: <description>Example:
feat(auth): add JWT authentication
fix(ui): resolve button alignment issueCommon commit types
| Type | Description |
|---|---|
feat | Introduces a new feature |
fix | Fixes a bug |
docs | Updates documentation |
style | Code style changes (whitespace, formatting, missing semicolons) |
refactor | Code restructuring without changing behavior |
perf | Improves performance |
test | Adds or updates tests |
chore | Maintenance tasks (e.g., package updates, build process changes) |
ci | CI/CD-related changes |
Writing clear commit messages
Use the imperative mood:
fix(login): handle null password error # good
fixed issue with null password # avoidKeep it concise:
- Limit subject lines to 50 characters.
- Use present tense (e.g., "fix" instead of "fixed").
- Wrap the body at 72 characters per line if additional context is needed.
- Keep commits small and focused — avoid committing thousands of lines at once.
- Avoid committing large changes (e.g., 10,000 lines or 100 files), as they are difficult to review.
Writing meaningful commit messages
Good example:
feat(api): add rate limiting to prevent abuse> Added an IP-based rate-limiting mechanism using Redis to throttle requests and prevent abuse. This will help improve API reliability under high traffic conditions.
Avoid generic commit messages:
update
fix bug
refactor stuffBetter alternatives:
fix(auth): correct token expiration logic
chore(deps): update React to v18Use Conventional Commits
If your project follows Semantic Versioning, Conventional Commits helps automate versioning and changelogs:
feat!: introduce breaking change to APIThe ! indicates a breaking change.
Optional: add emojis for readability
Some teams use emojis to make commit logs visually appealing, for example:
✨ feat(auth): add OAuth login
🐛 fix(ui): resolve dropdown bug
📚 docs(readme): update installation stepsSummary
By following these commit message conventions, you ensure a clear history, easier collaboration, and better automation (changelog generation, release management). Adopting a structured commit naming convention makes your codebase more maintainable and improves teamwork efficiency.