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: commands/version/index.html
+13-2Lines changed: 13 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2111,14 +2111,25 @@ <h2 id="components-and-next-version">Components and next version<a class="header
2111
2111
<ul>
2112
2112
<li><strong><code>--major</code></strong>, <strong><code>--minor</code></strong>, <strong><code>--patch</code></strong>: print only that component of the (possibly manual) project version. Requires <code>--project</code>, <code>--verbose</code>, or a manual version.</li>
2113
2113
<li><strong><code>--next</code><code>[MAJOR|MINOR|PATCH|NONE]</code></strong>: print the version after applying that bump to the current project or manual version. <code>NONE</code> leaves the version unchanged.</li>
2114
+
<li><strong><code>--next USE_GIT_COMMITS</code></strong>: derive the bump automatically from the commits since the tag matching the current version, using your commit rules' bump map (the same logic as <code>cz bump</code>). Passing <code>--next</code> with no value defaults to <code>USE_GIT_COMMITS</code>. If no tag matches the current version, all commits are considered. When there are no new commits (and the current version is not a pre-release), the command errors out. The functionality does not yet include advanced versioning like prereleases or exact_increment.</li>
2114
2115
<li><strong><code>--tag</code></strong>: print the version formatted with your <code>tag_format</code> (requires <code>--project</code> or <code>--verbose</code>).</li>
2115
2116
</ul>
2116
-
<p><code>--next USE_GIT_COMMITS</code> is reserved for a future feature (derive the bump from git history) and is not implemented yet.</p>
Copy file name to clipboardExpand all lines: commands/version/index.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,15 +11,25 @@ Get the version of the installed Commitizen or the current project (default: ins
11
11
12
12
-**`--major`**, **`--minor`**, **`--patch`**: print only that component of the (possibly manual) project version. Requires `--project`, `--verbose`, or a manual version.
13
13
-**`--next``[MAJOR|MINOR|PATCH|NONE]`**: print the version after applying that bump to the current project or manual version. `NONE` leaves the version unchanged.
14
+
-**`--next USE_GIT_COMMITS`**: derive the bump automatically from the commits since the tag matching the current version, using your commit rules' bump map (the same logic as `cz bump`). Passing `--next` with no value defaults to `USE_GIT_COMMITS`. If no tag matches the current version, all commits are considered. When there are no new commits (and the current version is not a pre-release), the command errors out. The functionality does not yet include advanced versioning like prereleases or exact_increment.
14
15
-**`--tag`**: print the version formatted with your `tag_format` (requires `--project` or `--verbose`).
15
16
16
-
`--next USE_GIT_COMMITS` is reserved for a future feature (derive the bump from git history) and is not implemented yet.
17
-
18
17
## Examples
19
18
20
19
```
21
20
cz version --project
22
21
cz version 2.0.0 --next MAJOR
23
22
cz version --project --major
24
23
cz version --verbose
24
+
25
+
# Derive the next version from the commits since the current version's tag
26
+
cz version --project --next USE_GIT_COMMITS
27
+
# Equivalent shorthand (--next defaults to USE_GIT_COMMITS)
28
+
cz version --project --next
29
+
# Retrieve just the next major part of the version
30
+
cz version --project --next --major
31
+
# Works with a manual version too
32
+
cz version 1.4.0 --next
33
+
# Combine with --tag to format the derived version using your tag_format
0 commit comments