Conventional Commits
A common message style.
Many teams agree on one style for commit messages, so the history is easy to scan, and tools can read it. The most popular style is called conventional commits.

- One shared message style
- Easy to scan
- Tools can read it
The format
Each message starts with a type, then a colon, then a short description. Feat, for a new feature. Fix, for a bug fix. Docs, for documentation. Style, refactor and test for the rest. You can add a scope in brackets, like fix, open bracket, contact, close bracket.
| key | value |
|---|---|
| feat: add dark mode | new feature |
| fix(contact): validate email | bug fix, with scope |
| docs: update README | documentation |
| refactor: split styles | no behaviour change |
Writing them
Here's what it looks like in practice. A feature, and a fix with a scope. When every commit follows the pattern, the log reads like a changelog. Some tools even generate release notes, and version numbers, automatically from these messages.
echo 'body.dark { background: #111; }' >> style.css git commit -am "feat: add dark mode styles" [main 03d48f3] feat: add dark mode styles 1 file changed, 1 insertion(+) echo '<p>Email required</p>' >> contact.html git commit -am "fix(contact): explain required email" [main 84f803d] fix(contact): explain required email 1 file changed, 1 insertion(+) git log --oneline -n 3 84f803d (HEAD -> main) fix(contact): explain required email 03d48f3 feat: add dark mode styles 4a9b0f8 Link to contact page
Summary
Conventional commits start with a type, like feat or fix, then a description. Your team decides if you use them. Next, fixing the most common real-life Git mistakes.
Key takeaways- type: description
- feat, fix, docs, refactor
- Optional (scope)