Git tag semantic version bumper
gbump scans all git tags, finds the highest SemVer
value (including prerelease/build metadata), prints the current version, and
shows the bumped value that would be created next. The tool understands the
standard major, minor, and patch increments and can optionally create the
annotated tag for you.
To install:
cargo install gbump
You can copy gbump to /usr/local/bin/gbump or somewhere available in your path
For usage type:
$ gbump -h
SemVer options are: patch, minor, major. (defaults to patch)
For example if current version tag is 0.1.1:
Using patch will bump 0.1.1 to 0.1.2
$ gbump patch
0.1.1 --> 0.1.2
Using minor will bump 0.1.1 to 0.2.0
$ gbump minor
0.1.1 --> 0.2.0
Using major will bump 0.1.1 to 1.0.0
$ gbump major
0.1.1 --> 1.0.0
If only need the next semver, use option -q. for example:
$ gbump -q major
1.0.0
To create a git tag using the latest bump use the flag -t:
$ gbump -t minor
Tag: 0.2.0 created: 5b1eca044a538fd2f74c4f043f28ca4a46b8f7b7
Use -ts to create a GPG-signed tag instead of the default annotated tag:
$ gbump -ts patch
Tag: 0.0.1 created: <oid>
The command shells out to git tag -s, so make sure your signing key and
gpg.program are configured in the repository or environment.
GBUMP_FORCE_TAG_FAILURE=1— forces the internal tag lookup to fail. This is mainly useful for tests or CI workflows where you want to confirm the error path.