You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/commands/bump.md
+46-32Lines changed: 46 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,7 @@ Commitizen supports the [PEP 440][pep440] version format, which includes several
111
111
112
112
### `--files-only`
113
113
114
-
Bumps the version in the files defined in [`version_files`](#version_files) without creating a commit and tag on the git repository,
114
+
Bumps the version in the files defined in [`version_files`](#version_files) without creating a commit and tag on the git repository.
115
115
116
116
```bash
117
117
cz bump --files-only
@@ -128,7 +128,7 @@ cz bump --changelog
128
128
### `--prerelease`
129
129
130
130
The bump is a pre-release bump, meaning that in addition to a possible version bump the new version receives a
131
-
pre-release segment compatible with the bump’s version scheme, where the segment consist of a _phase_ and a
131
+
pre-release segment compatible with the bump's version scheme, where the segment consists of a _phase_ and a
132
132
non-negative number. Supported options for `--prerelease` are the following phase names `alpha`, `beta`, or
133
133
`rc` (release candidate). For more details, refer to the
134
134
[Python Packaging User Guide](https://packaging.python.org/en/latest/specifications/version-specifiers/#pre-releases).
@@ -281,19 +281,20 @@ Any other messages generated by `cz bump` will be sent to `stderr`.
281
281
When this flag is used, `--changelog` is implied.
282
282
However, it is recommended to set `--changelog` (or the setting `update_changelog_on_bump`) explicitly when the option `--changelog-to-stdout` is used.
283
283
284
-
#### Useful scenarios
284
+
!!! note "Useful scenarios"
285
+
Pipe the newly created changelog to another tool.
285
286
286
-
This is useful to pipe the newly created changelog to another tool. For example, it can be sent to an auditing system, or to create a GitHub Release, etc.
287
+
The output can be redirected to an auditing system, or used to create a GitHub Release, etc.
If `--git-output-to-stderr` is used, git commands output is redirected to `stderr`.
295
+
Redirects gitcommands output to `stderr`.
295
296
296
-
Useful when used with `--changelog-to-stdout` and piping the output to a file,
297
+
Useful when used with `--changelog-to-stdout` and piping the output to a file.
297
298
298
299
For example, `git commit` output may pollute `stdout`, so it is recommended to use this flag when piping the output to a file.
299
300
@@ -306,7 +307,7 @@ Useful to combine with code formatters, like [Prettier](https://prettier.io/).
306
307
307
308
### `--major-version-zero`
308
309
309
-
Breaking changes does not bump the major version number.
310
+
Breaking changes do not bump the major version number.
310
311
311
312
Say you have a project with the version `0.1.x` and you commit a breaking change like this:
312
313
@@ -344,7 +345,7 @@ Then the version of your project will be bumped to `0.2.0` instead of `1.0.0`.
344
345
345
346
### `--gpg-sign`
346
347
347
-
Create gpg signed tags.
348
+
Creates gpg signed tags.
348
349
349
350
```bash
350
351
cz bump --gpg-sign
@@ -367,18 +368,16 @@ See [the template customization section](../customization.md#customizing-the-cha
367
368
368
369
### `--build-metadata`
369
370
370
-
Provides a way to specify additional metadata in the version string. This parameter is not compatible with `--local-version` as it uses the same part of the version string.
371
+
Specifies additional metadata in the version string.
371
372
372
373
```bash
374
+
# creates a version like `1.1.2+yourmetadata`.
373
375
cz bump --build-metadata yourmetadata
374
376
```
375
377
376
-
Will create a version like `1.1.2+yourmetadata`.
377
-
378
-
This can be useful for multiple things
379
-
380
-
- Git hash in version
381
-
- Labeling the version with additional metadata.
378
+
!!! note "Example usage"
379
+
- Git hash in version
380
+
- Labeling the version with additional metadata.
382
381
383
382
!!! note
384
383
Commitizen ignores everything after `+` when it bumps the version.
@@ -392,16 +391,19 @@ This can be useful for multiple things
392
391
- Version `1.2.3+a`, and `1.2.3+b` are the same version! Tools should not use the string after `+` for version calculation. This is probably not a guarantee (example in helm) even tho it is in the spec.
393
392
- It might be problematic having the metadata in place when doing upgrades depending on what tool you use.
394
393
394
+
!!! warning
395
+
This parameter is not compatible with `--local-version` as it uses the same part of the version string.
396
+
395
397
### `--get-next`
396
398
397
-
Provides a way to determine the next version and write it to stdout. This parameter is not compatible with `--changelog`
398
-
and `manual version`.
399
+
Similar to `--dry-run` but only outputs the next version.
399
400
400
401
```bash
402
+
# outputs 1.0.1 if the current version is 1.0.0 and the increment is PATCH
401
403
cz bump --get-next
402
404
```
403
405
404
-
Will only output the next version, e.g., `1.2.3`. This can be useful for determining the next version based on CI for non-production environments/builds.
406
+
Useful for determining the next version based on CI for non-production environments/builds.
405
407
406
408
!!! note "Compare with `--dry-run`"
407
409
`--dry-run` provides a more detailed output including the changes as they would appear in the changelog file, while `--get-next` only outputs the next version.
@@ -427,15 +429,27 @@ Will only output the next version, e.g., `1.2.3`. This can be useful for determi
427
429
428
430
### `--allow-no-commit`
429
431
430
-
Allow the project version to be bumped even when there's no eligible version. This is most useful when used with `--increment {MAJOR,MINOR,PATCH}` or `[MANUAL_VERSION]`
432
+
Allow the project version to be bumped even when there's no eligible version.
431
433
432
-
```sh
433
-
# bump a minor version even when there's only bug fixes, documentation changes or even no commits
434
-
cz bump --incremental MINOR --allow-no-commit
434
+
!!! note "Example usage"
435
+
```sh
436
+
# bump a minor version even when there's only bug fixes, documentation changes or even no commits
435
437
436
-
# bump version to 2.0.0 even when there's no breaking changes changes or even no commits
437
-
cz bump --allow-no-commit 2.0.0
438
-
```
438
+
cz bump --increment MINOR --allow-no-commit
439
+
440
+
# bump version to 2.0.0 even when there's no breaking changes or even no commits
441
+
cz bump --allow-no-commit 2.0.0
442
+
```
443
+
444
+
!!! note "Default increment"
445
+
The increment is overridden to `PATCH` if there is no increment detected or specified.
446
+
447
+
In other words, `cz bump --allow-no-commit` allows you to bump the version to the next patch version even when there is no eligible commit.
448
+
449
+
```sh
450
+
# will bump to `1.0.1` if the current version is `1.0.0`.
0 commit comments