Skip to content

Commitizen

Commitizen is a tool that defines a standard way of committing.

It can bump the version of your project automatically based on commits and generate a changelog file.

Installation

pip install commitizen

Configuration

If your project version is not detected automatically or it isn't specified you can add the files where the version appears or the version respectively to .cz.toml as shown in the following examples:

[tool.commitizen]
version_files = [
    "src/__version__.py",
    "setup.py",
]
[tool.commitizen]
version = "0.2.2"

Usage

To commit:

cz commit

To retry a failed commit:

cz commit --retry

To bump the version and update the changelog:

cz bump --changelog --no-verify