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:

bash
<type>(<scope>): <description>
<type>: <description>

Example:

bash
feat(auth): add JWT authentication
fix(ui): resolve button alignment issue

Common commit types

TypeDescription
featIntroduces a new feature
fixFixes a bug
docsUpdates documentation
styleCode style changes (whitespace, formatting, missing semicolons)
refactorCode restructuring without changing behavior
perfImproves performance
testAdds or updates tests
choreMaintenance tasks (e.g., package updates, build process changes)
ciCI/CD-related changes

Writing clear commit messages

Use the imperative mood:

bash
fix(login): handle null password error   # good
fixed issue with null password           # avoid

Keep it concise:

Writing meaningful commit messages

Good example:

bash
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:

bash
update
fix bug
refactor stuff

Better alternatives:

bash
fix(auth): correct token expiration logic
chore(deps): update React to v18

Use Conventional Commits

If your project follows Semantic Versioning, Conventional Commits helps automate versioning and changelogs:

bash
feat!: introduce breaking change to API

The ! indicates a breaking change.

Optional: add emojis for readability

Some teams use emojis to make commit logs visually appealing, for example:

bash
✨ feat(auth): add OAuth login
🐛 fix(ui): resolve dropdown bug
📚 docs(readme): update installation steps

Summary

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.