|
2 | 2 |
|
3 | 3 | ## About
|
4 | 4 |
|
5 |
| -`cz bump` **automatically** increases the version, based on the commits. |
| 5 | +`cz bump` is a powerful command that **automatically** determines and increases your project's version number based on your commit history. It analyzes your commits to determine the appropriate version increment according to semantic versioning principles. |
6 | 6 |
|
7 |
| -The commits should follow the rules established by the committer in order to be parsed correctly. |
| 7 | +### Key Features |
8 | 8 |
|
9 |
| -**prerelease** versions are supported (alpha, beta, release candidate). |
| 9 | +- **Automatic Version Detection**: Analyzes commit history to determine the appropriate version bump |
| 10 | +- **Manual Version Control**: Supports manual version specification when needed |
| 11 | +- **Pre-release Support**: Handles alpha, beta, and release candidate versions |
| 12 | +- **Multiple Version Schemes**: Supports both [PEP 0440][pep440] and [semantic versioning][semver] formats |
10 | 13 |
|
11 |
| -The version can also be **manually** bumped. |
| 14 | +### Version Increment Rules |
12 | 15 |
|
13 |
| -The version format follows [PEP 0440][pep440] and [semantic versioning][semver]. |
14 |
| - |
15 |
| -This means `MAJOR.MINOR.PATCH` |
| 16 | +The version follows the `MAJOR.MINOR.PATCH` format, with increments determined by your commit types: |
16 | 17 |
|
17 | 18 | | Increment | Description | Conventional commit map |
|
18 | 19 | | --------- | --------------------------- | ----------------------- |
|
19 |
| -| `MAJOR` | Breaking changes introduced | `BREAKING CHANGE` | |
| 20 | +| `MAJOR` | Breaking changes introduced | `BREAKING CHANGE`, bang (e.g. `feat!`)| |
20 | 21 | | `MINOR` | New features | `feat` |
|
21 |
| -| `PATCH` | Fixes | `fix` + everything else | |
| 22 | +| `PATCH` | Fixes and improvements | `fix`, `perf`, `refactor`| |
| 23 | + |
| 24 | +### Version Schemes |
22 | 25 |
|
23 |
| -[PEP 0440][pep440] is the default, you can switch by using the setting `version_scheme` or the cli: |
| 26 | +By default, Commitizen uses [PEP 0440][pep440] for version formatting. You can switch to semantic versioning using either: |
24 | 27 |
|
| 28 | +1. Command line: |
25 | 29 | ```sh
|
26 | 30 | cz bump --version-scheme semver
|
27 | 31 | ```
|
28 | 32 |
|
29 |
| -Some examples of pep440: |
| 33 | +2. Configuration file: |
| 34 | +```toml |
| 35 | +[tool.commitizen] |
| 36 | +version_scheme = "semver" |
| 37 | +``` |
30 | 38 |
|
31 |
| -```bash |
32 |
| -0.9.0 |
33 |
| -0.9.1 |
34 |
| -0.9.2 |
35 |
| -0.9.10 |
36 |
| -0.9.11 |
37 |
| -1.0.0a0 # alpha |
38 |
| -1.0.0a1 |
39 |
| -1.0.0b0 # beta |
40 |
| -1.0.0rc0 # release candidate |
41 |
| -1.0.0rc1 |
42 |
| -1.0.0 |
43 |
| -1.0.1 |
44 |
| -1.1.0 |
45 |
| -2.0.0 |
46 |
| -2.0.1a |
47 |
| -``` |
48 |
| - |
49 |
| -`post` releases are not supported yet. |
| 39 | +### PEP440 Version Examples |
| 40 | + |
| 41 | +Commitizen supports the [PEP 440][pep440] version format, which includes several version types. Here are examples of each: |
| 42 | + |
| 43 | +#### Standard Releases |
| 44 | +```text |
| 45 | +0.9.0 # Initial development release |
| 46 | +0.9.1 # Patch release |
| 47 | +0.9.2 # Another patch release |
| 48 | +0.9.10 # Tenth patch release |
| 49 | +0.9.11 # Eleventh patch release |
| 50 | +1.0.0 # First stable release |
| 51 | +1.0.1 # Patch release after stable |
| 52 | +1.1.0 # Minor feature release |
| 53 | +2.0.0 # Major version release |
| 54 | +``` |
| 55 | + |
| 56 | +#### Pre-releases |
| 57 | +```text |
| 58 | +1.0.0a0 # Alpha release 0 |
| 59 | +1.0.0a1 # Alpha release 1 |
| 60 | +1.0.0b0 # Beta release 0 |
| 61 | +1.0.0rc0 # Release candidate 0 |
| 62 | +1.0.0rc1 # Release candidate 1 |
| 63 | +``` |
| 64 | + |
| 65 | +#### Development Releases |
| 66 | +```text |
| 67 | +1.0.0.dev0 # Development release 0 |
| 68 | +1.0.0.dev1 # Development release 1 |
| 69 | +``` |
| 70 | + |
| 71 | +#### Combined Pre-release and Development |
| 72 | +```text |
| 73 | +1.0.0a1.dev0 # Development release 0 of alpha 1 |
| 74 | +1.0.0b2.dev1 # Development release 1 of beta 2 |
| 75 | +``` |
| 76 | + |
| 77 | +> **Note**: `post` releases (e.g., `1.0.0.post1`) are not currently supported. |
50 | 78 |
|
51 | 79 | ## Usage
|
52 | 80 |
|
@@ -97,7 +125,7 @@ by their precedence and showcase how a release might flow through a development
|
97 | 125 | By default, `--increment-mode` is set to `linear`, which ensures that bumping pre-releases _maintains linearity_:
|
98 | 126 | bumping of a pre-release with lower precedence than the current pre-release phase maintains the current phase of
|
99 | 127 | higher precedence. For example, if the current version is `1.0.0b1` then bumping with `--prerelease alpha` will
|
100 |
| -continue to bump the “beta” phase. |
| 128 | +continue to bump the "beta" phase. |
101 | 129 |
|
102 | 130 | Setting `--increment-mode` to `exact` instructs `cz bump` to instead apply the
|
103 | 131 | exact changes that have been specified with `--increment` or determined from the commit log. For example,
|
@@ -223,7 +251,7 @@ If used together with a manual version the command also fails.
|
223 | 251 |
|
224 | 252 | We recommend setting `major_version_zero = true` in your configuration file while a project
|
225 | 253 | is in its initial development. Remove that configuration using a breaking-change commit to bump
|
226 |
| -your project’s major version to `v1.0.0` once your project has reached maturity. |
| 254 | +your project's major version to `v1.0.0` once your project has reached maturity. |
227 | 255 |
|
228 | 256 | ### `--version-scheme`
|
229 | 257 |
|
|
0 commit comments