Commit Message Standards
What is a Commit?
A commit is a snapshot of your repository at a specific point in time. It records changes to your files, allowing you to track the history of your project and collaborate with others.
Types of Commits
- feat: A new feature for the user, not a new feature for build script.
- fix: A bug fix for the user, not a fix to a build script.
- docs: Changes to the documentation only.
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
- refactor: A code change that neither fixes a bug nor adds a feature.
- perf: A code change that improves performance.
- test: Adding missing or correcting existing tests.
- chore: Changes to the build process or auxiliary tools and libraries such as documentation generation.
Commit Message Format
<type>(<scope>): <subject>
<type>
: The type of the commit (e.g.,feat
,fix
,docs
).<scope>
: The scope of the commit (e.g.,develop
,main
).<subject>
: A concise description of the commit.
Breaking Change
If your commit introduces a breaking change that will affect users, include BREAKING_CHANGE
in the commit message. This helps users understand the impact of the change and take necessary actions to update their code.
Example with Breaking Change:
feat(develop): Added new feature to API
BREAKING_CHANGE: This commit introduces a breaking change to the API's response format.