Git – Commit Messages
Follow the Conventional Commits specification.
Format
Examples
feat(auth): add OAuth2 login flow
fix(payments): handle declined card timeout
refactor(user): extract validation into UserValidator
chore(deps): upgrade Spring Boot to 3.2.1
Types
| Type | When to use |
|---|---|
feat |
New feature |
fix |
Bug fix |
refactor |
Code change, no feature or fix |
docs |
Documentation only |
test |
Adding or updating tests |
chore |
Build process, dependencies |
perf |
Performance improvement |
Rules
- Subject line must be 72 characters or less
- Use imperative mood: "add login" not "added login"
- No period at the end of subject line
- Body should explain WHY not WHAT