Skip to content

Commit Message Convention

Why Use a Convention?

  • Clarity: Clearly explain each commit's purpose.

  • Searchability: Easily find specific changes using commit messages.

  • Release Notes: Simplify the creation of meaningful release notes.

  • Collaboration: Improve teamwork with a standardised way to document changes.

Steps to Set Up a Convention

1. Choose a Format

<type>(<scope>): <message>

Commit Message Format

  • <type>: Purpose of the commit (e.g., feat, fix, docs).
  • <scope> (optional): Module/component affected by the commit.
  • <message>: Clear description of changes made.

Define Types

Common types include:

  • feat: New feature or significant change.
  • fix: Bug fix.
  • docs: Documentation changes.
  • style: Code style changes.
  • refactor: Code refactoring.
  • test: Test-related changes.
  • chore: Routine tasks or maintenance.

Message Guidelines

  • Use the imperative mood.
  • Keep messages concise.

Examples

New Feature:

feat(user-auth): add user registration

Bug:

fix(api): resolve status issue

Documentation:

docs(readme): update installation