Tools

git-tagup

Tags from your commit messages: find the commits that bumped a version and tag them, one confirmation at a time.

  1. Scans the checked-out branch for commits that carry a version number in their message and have no tag yet.SemVerActive branchUntagged commits only
  2. Asks before every tag: y to create it, n to skip, q to stop. Nothing is pushed.InteractiveOne tag at a timeLocal until you push
  3. Push the tags in one go and the releases exist where everyone can see them.git push --follow-tagsGitHub releasesChangelogs

The problem it solves

The version went into the commit message. The tag never happened.

If you are like me, you put the version number for a release into the commit message itself:

$ git commit -m "Bump version to 2.1.5"

And if you are still like me, you forget to create a tag for the new version and push it. Projects end up with months or years of un-tagged releases that only exist as commit messages.

git-tagup searches the active branch for un-tagged commits whose messages contain a version number. For each one it finds, it asks whether to create the tag. Only SemVer numbers are recognised for now; other formats are welcome as requests.

A session

One question per commit, newest last.

$ cd path/to/project/root
$ git-tagup
Create the tag 'v0.1.1' for commit message 'Bump version to 0.1.1'? (y/n/q): n
Create the tag 'v0.1.2' for commit message 'Bump version to 0.1.2'? (y/n/q): y
Create the tag 'v0.1.3' for commit message 'Bump version to 0.1.3'? (y/n/q): q

Tags are created locally. When you are done, git push --follow-tags sends them to the remote along with your commits.

Install and run

Python 3.6 or newer and Git.

1
Install
pip install git-tagup

or pipx install git-tagup

2
In the repository, on the branch whose commits you want tagged
cd path/to/project/root
git-tagup

Answer y to create a tag, n to skip that commit, q to stop.

3
Push the new tags
git push --follow-tags

Not sure what that will do? git-sim push shows you first.

Questions

Which version formats does it recognise?

SemVer, such as 1.4.0 or v2.1.5, anywhere in the commit message. The tag it proposes is the number with a v prefix. Other formats are welcome as feature requests.

Can it tag the wrong commit?

Only if you say yes to it. Every tag is proposed with the commit message it came from, and nothing is created without a y. Tags stay local until you push them.

Does it look at every branch?

No, only the checked-out branch. Check out the branch whose releases you want tagged, usually main, and run it there.

What if a version is already tagged?

Commits that already carry a tag are skipped, so running it again after new releases only asks about the new ones.

git-tagup is free and open source, made by Jacob Stopak for Initial Commit.