Skip to main content

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

  1. feat: A new feature for the user, not a new feature for build script.
  2. fix: A bug fix for the user, not a fix to a build script.
  3. docs: Changes to the documentation only.
  4. style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
  5. refactor: A code change that neither fixes a bug nor adds a feature.
  6. perf: A code change that improves performance.
  7. test: Adding missing or correcting existing tests.
  8. 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.