Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to get started using Bumpversion. [a great tool to simplify git tagging with semantic versioning]

Bumpversion Quickstart

See: https://github.com/peritus/bumpversion

Install

pip3 install bumpversion

First time use

$ git init /tmp/bar
Initialized empty Git repository in /tmp/bar/.git/

$ cd /tmp/bar

$ touch README.md

$ git add -A

$ git commit -m 'Initial'

$ bumpversion patch --tag --list --new-version 0.1.0
new_version=0.1.0

$ git log
commit 579e46e295d7b22fa2f17e4049957275ef3071ce (HEAD -> master, tag: v0.1.0)
Author: Bruno Bronosky <Bruno@Bronosky.com>
Date:   Fri Sep 20 16:30:56 2019 -0400

    Initial

Update version

$ bumpversion patch --tag --list
new_version=0.1.1

$ git log
commit 579e46e295d7b22fa2f17e4049957275ef3071ce (HEAD -> master, tag: v0.1.1, tag: v0.1.0)
Author: Bruno Bronosky <Bruno@Bronosky.com>
Date:   Fri Sep 20 16:30:56 2019 -0400

    Initial

$ bumpversion minor --tag --list
new_version=0.2.0

$ git log
commit 579e46e295d7b22fa2f17e4049957275ef3071ce (HEAD -> master, tag: v0.2.0, tag: v0.1.1, tag: v0.1.0)
Author: Bruno Bronosky <Bruno@Bronosky.com>
Date:   Fri Sep 20 16:30:56 2019 -0400

    Initial

$ bumpversion major --tag --list
new_version=1.0.0

$ git log
commit 579e46e295d7b22fa2f17e4049957275ef3071ce (HEAD -> master, tag: v1.0.0, tag: v0.2.0, tag: v0.1.1, tag: v0.1.0)
Author: Bruno Bronosky <Bruno@Bronosky.com>
Date:   Fri Sep 20 16:30:56 2019 -0400

    Initial

$ git push --tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.