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).
@@ -280,19 +280,20 @@ Any other messages generated by `cz bump` will be sent to `stderr`.
280
280
When this flag is used, `--changelog` is implied.
281
281
However, it is recommended to set `--changelog` (or the setting `update_changelog_on_bump`) explicitly when the option `--changelog-to-stdout` is used.
282
282
283
-
#### Useful scenarios
283
+
!!! note "Useful scenarios"
284
+
Pipe the newly created changelog to another tool.
284
285
285
-
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.
286
+
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`.
294
+
Redirects gitcommands output to `stderr`.
294
295
295
-
Useful when used with `--changelog-to-stdout` and piping the output to a file,
296
+
Useful when used with `--changelog-to-stdout` and piping the output to a file.
296
297
297
298
For example, `git commit` output may pollute `stdout`, so it is recommended to use this flag when piping the output to a file.
298
299
@@ -305,7 +306,7 @@ Useful to combine with code formatters, like [Prettier](https://prettier.io/).
305
306
306
307
### `--major-version-zero`
307
308
308
-
Breaking changes does not bump the major version number.
309
+
Breaking changes do not bump the major version number.
309
310
310
311
Say you have a project with the version `0.1.x` and you commit a breaking change like this:
311
312
@@ -343,7 +344,7 @@ Then the version of your project will be bumped to `0.2.0` instead of `1.0.0`.
343
344
344
345
### `--gpg-sign`
345
346
346
-
Create gpg signed tags.
347
+
Creates gpg signed tags.
347
348
348
349
```bash
349
350
cz bump --gpg-sign
@@ -366,18 +367,16 @@ See [the template customization section](../customization.md#customizing-the-cha
366
367
367
368
### `--build-metadata`
368
369
369
-
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.
370
+
Specifies additional metadata in the version string.
370
371
371
372
```bash
373
+
# creates a version like `1.1.2+yourmetadata`.
372
374
cz bump --build-metadata yourmetadata
373
375
```
374
376
375
-
Will create a version like `1.1.2+yourmetadata`.
376
-
377
-
This can be useful for multiple things
378
-
379
-
- Git hash in version
380
-
- Labeling the version with additional metadata.
377
+
!!! note "Example usage"
378
+
- Git hash in version
379
+
- Labeling the version with additional metadata.
381
380
382
381
!!! note
383
382
Commitizen ignores everything after `+` when it bumps the version.
@@ -391,16 +390,19 @@ This can be useful for multiple things
391
390
- 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.
392
391
- It might be problematic having the metadata in place when doing upgrades depending on what tool you use.
393
392
393
+
!!! warning
394
+
This parameter is not compatible with `--local-version` as it uses the same part of the version string.
395
+
394
396
### `--get-next`
395
397
396
-
Provides a way to determine the next version and write it to stdout. This parameter is not compatible with `--changelog`
397
-
and `manual version`.
398
+
Similar to `--dry-run` but only outputs the next version.
398
399
399
400
```bash
401
+
# outputs 1.0.1 if the current version is 1.0.0 and the increment is PATCH
400
402
cz bump --get-next
401
403
```
402
404
403
-
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.
405
+
Useful for determining the next version based on CI for non-production environments/builds.
404
406
405
407
!!! note "Compare with `--dry-run`"
406
408
`--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.
@@ -426,15 +428,27 @@ Will only output the next version, e.g., `1.2.3`. This can be useful for determi
426
428
427
429
### `--allow-no-commit`
428
430
429
-
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]`
431
+
Allow the project version to be bumped even when there's no eligible version.
430
432
431
-
```sh
432
-
# bump a minor version even when there's only bug fixes, documentation changes or even no commits
433
-
cz bump --incremental MINOR --allow-no-commit
433
+
!!! note "Example usage"
434
+
```sh
435
+
# bump a minor version even when there's only bug fixes, documentation changes or even no commits
434
436
435
-
# bump version to 2.0.0 even when there's no breaking changes changes or even no commits
436
-
cz bump --allow-no-commit 2.0.0
437
-
```
437
+
cz bump --increment MINOR --allow-no-commit
438
+
439
+
# bump version to 2.0.0 even when there's no breaking changes or even no commits
440
+
cz bump --allow-no-commit 2.0.0
441
+
```
442
+
443
+
!!! note "Default increment"
444
+
The increment is overridden to `PATCH` if there is no increment detected or specified.
445
+
446
+
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.
447
+
448
+
```sh
449
+
# will bump to `1.0.1` if the current version is `1.0.0`.
0 commit comments