Skip to main content

Git Conventional Commit Standards


Guidelines

When you want to commit and push changes you made on merge request, below are some rules to follow:

  • Commit message must represent what you do on that commit.
  • Using a short, descriptive title in the first line of the commit message.
  • Using the imperative mood in the commit title ("Fix bug" instead of "Fixed bug").
  • Referencing issue numbers or identifiers in the commit message to link it with relevant project management systems (e.g., "Fixes #123").
  • Providing more details in the body of the commit message, if necessary.
  • Use active verbs, e.g.
    • adding special abilities.
  • Don’t commit files that you’ve not recognized, or you don’t know the changes. Stage and commit only for files that you’ve changed and know about it.

Commit Formats

<type>(<optional scope>):<subject>
empty separator line
<optional body>
empty separator line
<optional footer>

Message subject (First line)


The subject contains a succinct description of the change.

  • Is a mandatory part of the format
  • Use the imperative, present tense: "change" not "changed" nor "changes"
    • Think of This commit will <subject>
  • Don't capitalize the first letter
  • No dot (.) at the end

Types (First line)


  • feat Commits, that adds a new feature
  • fix Commits, that fixes a bug
  • assets Commits, that add assets
  • refactor Commits, that rewrite/restructure your code, however does not change any behaviour
    • perf Commits are special refactor commits, that improve performance
  • test Commits, that add missing tests or correcting existing tests
  • docs Commits, that affect documentation only
  • build Commits, that affect build components like build tool, ci pipeline, dependencies, project version,
  • ops Commits, that affect operational components like infrastructure, deployment, backup, recovery,
  • draft Commits, that implement tasks but not yet finished
  • chore Miscellaneous commits e.g. modifying .gitignore

Scopes (First line)


The scope provides additional contextual information.

  • Is an optional part of the format
  • Allowed Scopes depends on the specific project
  • Don't use issue identifiers as scopes

Body (Second line)


The body should include the motivation for the change and contrast this with previous behavior.

  • Is an optional part of the format
  • Use the imperative, present tense: "change" not "changed" nor "changes"
  • This is the place to mention issue identifiers and their relations

The footer should contain any information about Breaking Changes and is also the place to reference Issues that this commit refers to.

  • Is an optional part of the format
  • optionally reference an issue by its id.
  • Breaking Changes should start with the word BREAKING CHANGES: followed by space or two newlines. The rest of the commit message is then used for this.

Examples


EXAMPLES
feat(store): Implement Store Mechanic

- Implement store buy coins mechanic
- Integrate buy store coin API 
feat(shopping cart): add the amazing button

empty

refers to JIRA-1337

References

Conventional Commit Messages

Karma - Git Commit Msg