Skip to content

Instantly share code, notes, and snippets.

@RichardBronosky
Created September 20, 2019 20:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save RichardBronosky/237a88ff95f7ee434e34728eac564516 to your computer and use it in GitHub Desktop.
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