Read git diff --staged before writing anything. The message describes what is staged, nothing else.
Format
<type>(<scope>): <subject>
<body>
- type:
feat,fix,refactor,test,docs,ci,build,perforchore. Append!for a breaking change:feat!: …. - scope: optional, the area touched, e.g.
validatororci. - subject: English, imperative mood (
add, notadded), lowercase start, no trailing period, at most 72 characters including type and scope. - body: optional. Explain why, not what the diff already shows. Wrap at 72 characters.
One commit, one change
When the staged diff holds unrelated changes, propose how to split it before writing a message.
Examples
feat(api): add dashboard delete endpoints
fix(ci): pin action versions
feat!: relicense from MIT to GPL-3.0-or-later