Skip to content

Commit 7b5fed7

Browse files
committed
Deploying to gh-pages from @ e0de830 🚀
1 parent a694d4c commit 7b5fed7

10 files changed

Lines changed: 108 additions & 77 deletions

File tree

commands/version/index.html

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,14 +2111,25 @@ <h2 id="components-and-next-version">Components and next version<a class="header
21112111
<ul>
21122112
<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>
21132113
<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>
21142115
<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>
21152116
</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>
21172117
<h2 id="examples">Examples<a class="headerlink" href="#examples" title="Permanent link">&para;</a></h2>
21182118
<div class="highlight"><pre><span></span><code>cz<span class="w"> </span>version<span class="w"> </span>--project
21192119
cz<span class="w"> </span>version<span class="w"> </span><span class="m">2</span>.0.0<span class="w"> </span>--next<span class="w"> </span>MAJOR
21202120
cz<span class="w"> </span>version<span class="w"> </span>--project<span class="w"> </span>--major
21212121
cz<span class="w"> </span>version<span class="w"> </span>--verbose
2122+
2123+
<span class="c1"># Derive the next version from the commits since the current version&#39;s tag</span>
2124+
cz<span class="w"> </span>version<span class="w"> </span>--project<span class="w"> </span>--next<span class="w"> </span>USE_GIT_COMMITS
2125+
<span class="c1"># Equivalent shorthand (--next defaults to USE_GIT_COMMITS)</span>
2126+
cz<span class="w"> </span>version<span class="w"> </span>--project<span class="w"> </span>--next
2127+
<span class="c1"># Retrieve just the next major part of the version</span>
2128+
cz<span class="w"> </span>version<span class="w"> </span>--project<span class="w"> </span>--next<span class="w"> </span>--major
2129+
<span class="c1"># Works with a manual version too</span>
2130+
cz<span class="w"> </span>version<span class="w"> </span><span class="m">1</span>.4.0<span class="w"> </span>--next
2131+
<span class="c1"># Combine with --tag to format the derived version using your tag_format</span>
2132+
cz<span class="w"> </span>version<span class="w"> </span>--project<span class="w"> </span>--next<span class="w"> </span>--tag
21222133
</code></pre></div>
21232134

21242135

@@ -2140,7 +2151,7 @@ <h2 id="examples">Examples<a class="headerlink" href="#examples" title="Permanen
21402151
<span class="md-icon" title="Last update">
21412152
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"/></svg>
21422153
</span>
2143-
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="May 3, 2026 07:01:17 UTC">May 3, 2026</span>
2154+
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="July 24, 2026 10:22:15 UTC">July 24, 2026</span>
21442155
</span>
21452156

21462157

commands/version/index.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,25 @@ Get the version of the installed Commitizen or the current project (default: ins
1111

1212
- **`--major`**, **`--minor`**, **`--patch`**: print only that component of the (possibly manual) project version. Requires `--project`, `--verbose`, or a manual version.
1313
- **`--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.
1415
- **`--tag`**: print the version formatted with your `tag_format` (requires `--project` or `--verbose`).
1516

16-
`--next USE_GIT_COMMITS` is reserved for a future feature (derive the bump from git history) and is not implemented yet.
17-
1817
## Examples
1918

2019
```
2120
cz version --project
2221
cz version 2.0.0 --next MAJOR
2322
cz version --project --major
2423
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
34+
cz version --project --next --tag
2535
```

0 commit comments

Comments
 (0)