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 featurefix: correct a bugdocs: update documentationstyle: make formatting changes that do not alter behaviorrefactor: restructure code without changing behaviorperf: improve performancetest: add or update testschore: maintain project tooling or auxiliary filesci: change continuous integration configurationbuild: change build configuration or dependenciesrevert: undo an earlier commitwip: 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 dependencyUse 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.