← Engineering Blog

Software Engineering

Commit Message Format

A practical guide to writing structured Git commit messages with a clear type, optional scope, subject, body, and footer.

· 2 min read

GitGitHubCommit MessagesBest Practices

Commit Message Format

A consistent commit message makes the purpose of a change easier to understand in a project history. A useful format has a required header, followed by an optional body and footer:

<type>(<scope>): <subject>

<body>

<footer>

The scope is optional. Keep each line under 100 characters so messages remain readable in common Git tools.

Type

Choose a type that describes the change:

  • feat: add a feature
  • fix: correct a bug
  • docs: update documentation
  • style: make formatting changes that do not alter behavior
  • refactor: restructure code without changing behavior
  • perf: improve performance
  • test: add or update tests
  • chore: maintain project tooling or auxiliary files
  • ci: change continuous integration configuration
  • build: change build configuration or dependencies
  • revert: undo an earlier commit
  • wip: record work in progress

Subject, body, and footer

Write a short subject in the imperative and present tense, start it with a lowercase word, and omit the final period. For example:

fix: remove unused dependency

Use the body to explain why the change is needed and its effect. Use the footer for breaking changes and issue references. Mark a breaking change with BREAKING CHANGE: followed by an explanation.

Small, focused commits, consistent formatting, review, and automated checks all help make project history more useful.

Adapted from my original DEV Community article.

Search RefactorRoom

Search articles and labs as you type.

Start typing to search the site.