git-bump is a simple extension for git that mimics the usage of npm version for generating new git tags.
git bump <command>| Command | Description |
|---|---|
git bump major |
Bump the major version (v1.2.3 -> v2.0.0) |
git bump minor |
Bump the minor version (v1.2.3 -> v1.3.0) |
git bump patch |
Bump the patch version (v1.2.3 -> v1.2.4) |
git bump manual <tag> |
Create the given tag instead of bumping the latest one |
git bump latest |
Print the latest tag of the repository |
git bump version |
Print the git-bump version |
git bump update |
Update git-bump to the latest release |
Every bump creates the tag locally and pushes it to origin.
If no tags are found, v1.0.0 is created automatically.
git bump patch # New Tag: v1.2.4
git bump manual v2.0.0-rc1 # New Tag: v2.0.0-rc1Run git bump --help or git bump <command> --help for the full documentation.
Via Go (recommended)
go install github.com/neozmmv/git-bump@latestWindows
irm https://raw.githubusercontent.com/neozmmv/git-bump/master/install.ps1 | iexLinux
curl -fsSL https://raw.githubusercontent.com/neozmmv/git-bump/master/install.sh | bashgit bump updateIt updates the same way it was installed: a binary sitting in the Go bin
directory (go env GOBIN, else go env GOPATH/bin) is updated with
go install github.com/neozmmv/git-bump@latest, anything else by re-running the
install script above. Installs outside your home directory may ask for sudo.
Releases are built by .github/workflows/release.yml.
Pushing a v* tag builds the three binaries from a clean checkout of that tag
and publishes them as a release named git bump <tag>:
git bump patch # tags v1.2.4 and pushes it -> the workflow does the restThe version printed by git bump version is the VCS stamp Go embeds at build
time, so it is exactly the tag when built from a clean checkout of one. The
workflow fails the release if a built binary does not report the tag being
released.