// Frequently asked questions and practical guidance for implementing Conventional Commits in your workflow.
| name | faq |
| description | Frequently asked questions and practical guidance for implementing Conventional Commits in your workflow. |
The primary goal is to provide a lightweight convention on top of commit messages that makes it easier to:
Benefits:
Initially, yes - it requires thinking about commit structure. However, it saves time by:
We recommend that you proceed as if you've already released the product. Typically someone, even if it's your fellow software developers, is using your software. They'll want to know what's fixed, what breaks, etc. Starting with Conventional Commits from day one establishes good habits.
Any casing may be used, but consistency is important. Lowercase is recommended:
✓ feat: add dark mode
✓ fix: resolve null pointer
✗ Feat: add dark mode
✗ Fix: resolve null pointer
Go back and make multiple commits whenever possible. Part of the benefit of Conventional Commits is its ability to drive you to make more organized commits and PRs.
Example - Avoid:
feat: add payment processing and fix calculation bug
Better - Make Two Commits:
feat: add Stripe payment integration
fix: correct order total calculation
Start with lowercase (unless using parenthesis for scope):
✓ feat: add dark mode support
✓ feat(ui): add dark mode support
✗ feat: Add dark mode support
✗ feat(ui): Add dark mode support
Always use imperative mood (command form), not past tense:
✓ feat: add user authentication
✓ fix: resolve login issue
✓ refactor: simplify request handling
✗ feat: added user authentication
✗ fix: resolved login issue
✗ refactor: simplified request handling
This matches the convention used by git itself (e.g., "revert: revert commit X").
No, omit the period:
✓ feat: add authentication support
✗ feat: add authentication support.
Keep it concise - ideally 50 characters or less. This prevents truncation in various git tools and displays:
✓ feat: add OAuth2 authentication (40 chars)
✗ feat: add OAuth2 authentication support to the application (too long)
If you need more space, use the body.
Scope: Brief context about which part of the system is affected (wrapped in parenthesis)
feat(auth): add OAuth2 support
Body: Detailed explanation of why and how, separated by blank line
feat(auth): add OAuth2 support
Implement OAuth2 authentication flow to provide better security
and support for federated identity providers. Users can now log in
with Google, GitHub, or Microsoft accounts.
Include a body when:
Skip the body for:
Two ways:
Option 1: Use ! before the colon
feat!: drop support for Node 6
feat(api)!: change authentication flow
Option 2: Use footer
feat: change authentication flow
BREAKING CHANGE: authentication now requires OAuth2 tokens
Option 3: Both (redundant but clear)
feat!: change authentication flow
BREAKING CHANGE: authentication now requires OAuth2 tokens
No - it discourages moving fast in a disorganized way. It helps you:
Fast iteration is still possible - you're just being intentional about commits.
Conventional Commits encourages us to make more of certain types of commits (like fixes and features). The specification explicitly allows custom types, so:
mycompany: proprietary integration with our system
performance-testing: results from performance benchmarks
Your team can extend the specification based on your needs.
Yes! In fact, squash-merge workflows are ideal:
This is a common workflow for open source projects.
Conventional Commits enable automatic semantic versioning:
| Commit Type | SemVer Change |
|---|---|
fix | PATCH (1.0.0 → 1.0.1) |
feat | MINOR (1.0.0 → 1.1.0) |
BREAKING CHANGE | MAJOR (1.0.0 → 2.0.0) |
Tools like semantic-release automatically parse commits and bump versions.
Popular tools that support or require Conventional Commits:
Yes, using tools like:
commitlint - Validate commit message format
npm install --save-dev @commitlint/config-conventional @commitlint/cli
husky - Run hooks on git events
npm install husky --save-dev
husky install
Before Merging/Release:
Use git rebase -i to edit the commit history:
git rebase -i HEAD~3 # Edit last 3 commits
After Release: The cleanup will depend on your tools and processes. Ideally, you're using automation that can skip malformed commits or handle them gracefully.
It's not the end of the world. The commit will simply be missed by tools that are based on the spec. Automated tools won't recognize it, but it doesn't break anything. Fix it in the next commit with a rebase if important.
You can still benefit from the concept:
No! Many projects use approaches like:
Quick Explanation:
"We use a standard format for commit messages so automated tools can understand what changed. It looks like: type(scope): description"
Example:
feat(payment): add Stripe integration
Benefits:
Options:
The Conventional Commits spec doesn't define revert behavior explicitly. Recommended approach:
revert: let us never again speak of the noodle incident
Refs: 676104e, a215868
Or include the original type:
fix: revert incorrect authentication changes from commit a215868
This reverts commit a215868. The previous approach caused issues with
federated identity providers.
Revert if:
Create new fix if:
Use SemVer to version your extensions:
@yourcompany/conventional-commits-config version 1.0.0License: Creative Commons - CC BY 3.0
Source: Conventional Commits v1.0.0