[bump] section controls how git-cliff calculates the next version number based on commit history using semantic versioning rules.
Semantic Versioning
git-cliff follows Semantic Versioning (SemVer) principles:- Major (X.0.0) - Breaking changes
- Minor (0.X.0) - New features (backward compatible)
- Patch (0.0.X) - Bug fixes (backward compatible)
Configuration Options
Configure how feature commits affect version increments.Behavior:
true- Features always trigger a minor version updatefalse(default) - Features trigger:- Patch version update if major version is 0
- Minor version update otherwise
- With
true:0.1.0→0.2.0(feature commit) - With
false:0.1.0→0.1.1(feature commit) - With
true:1.0.0→1.1.0(feature commit) - With
false:1.0.0→1.1.0(feature commit)
Configure how breaking changes affect version increments from 0.x to 1.0.Behavior:
true- Breaking changes always trigger major version update (including 0.x → 1.0)false(default) - Breaking changes trigger:- Minor version update if major version is 0
- Major version update otherwise
- With
true:0.9.0→1.0.0(breaking commit) - With
false:0.9.0→0.10.0(breaking commit) - With
true:1.5.0→2.0.0(breaking commit) - With
false:1.5.0→2.0.0(breaking commit)
Set the initial version when no tags are found in the repository.If not set, defaults to
0.1.0.Example:Custom regex pattern for commit types that should trigger major version increments.Matches against the commit type (first word before colon in conventional commits).Note: Commit type according to spec is only Now commits like
[a-zA-Z]+Example:major: redesign API will trigger a major version bump.Custom regex pattern for commit types that should trigger minor version increments.Matches against the commit type (first word before colon in conventional commits).Example:Now commits like
add: new feature will trigger a minor version bump.Force all version bumps to a specific type, regardless of commit content.Allowed values:This forces every version bump to be a minor increment.
majorminorpatch
Usage Examples
Standard SemVer Configuration
- Features → minor bump
- Breaking changes → major bump (even from 0.x)
- Fixes → patch bump
Pre-1.0 Development
- Features → patch bump in 0.x
- Breaking changes → minor bump in 0.x
Custom Commit Types
Force Specific Bump Type
Command Line Usage
Calculate Next Version
Use--bumped-version to calculate the next version without generating a changelog:
1.2.0
Generate Changelog for Next Version
Combine with Tags
Version Bump Logic
The version bump is determined by analyzing commits since the last tag:-
Breaking Changes (commits with
BREAKING CHANGE:footer or!after type/scope):- Major bump (if
breaking_always_bump_major = trueor version ≥ 1.0.0) - Minor bump (if
breaking_always_bump_major = falseand version < 1.0.0)
- Major bump (if
-
Features (commits with
feattype):- Minor bump (if
features_always_bump_minor = trueor version ≥ 1.0.0) - Patch bump (if
features_always_bump_minor = falseand version < 1.0.0)
- Minor bump (if
-
Fixes (commits with
fixtype):- Patch bump
-
Custom Patterns:
- Major bump (if matches
custom_major_increment_regex) - Minor bump (if matches
custom_minor_increment_regex)
- Major bump (if matches
-
Forced Bump:
- Use
bump_typeif configured
- Use