Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-bump

git-bump is a simple extension for git that mimics the usage of npm version for generating new git tags.

Usage

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-rc1

Run git bump --help or git bump <command> --help for the full documentation.

Installation

Via Go (recommended)

go install github.com/neozmmv/git-bump@latest

Windows

irm https://raw.githubusercontent.com/neozmmv/git-bump/master/install.ps1 | iex

Linux

curl -fsSL https://raw.githubusercontent.com/neozmmv/git-bump/master/install.sh | bash

Updating

git bump update

It 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.

Releasing

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 rest

The 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.

About

Simple Go tool for applying semantic versioning to git tags.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages