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
fix(bump): auto-increment prerelease when tag already exists (#258)
* fix(bump): auto-increment prerelease when tag already exists
* fix(bump): auto-increment unnamed prerelease when tag already exists
* docs: add prerelease collision avoidance to README
Update readme explaining how --prerelease automatically increments
the numeric suffix when a tag already exists for the same base version
and prerelease channel.
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -284,6 +284,20 @@ npm run release -- --prerelease alpha
284
284
285
285
This will tag the version as: `1.0.1-alpha.0`
286
286
287
+
#### Prerelease Tag Collision Avoidance
288
+
289
+
When cutting a prerelease with `--prerelease`, `commit-and-tag-version` automatically checks existing git tags (respecting your `tagPrefix` configuration) for the same base version and prerelease channel. If a tag already exists, the numeric suffix is automatically incremented to avoid conflicts.
290
+
291
+
For example, if you're working with multiple prerelease channels simultaneously:
This behavior applies to both named prereleases (e.g., `-alpha.0`, `-beta.1`) and unnamed prereleases (e.g., `-0`, `-1`), ensuring that you can safely cut multiple prerelease versions without encountering git tag conflicts.
300
+
287
301
### Release as a Target Type Imperatively (`npm version`-like)
288
302
289
303
To forgo the automated version bump use `--release-as` with the argument `major`, `minor` or `patch`.
0 commit comments