Posted on • Originally published atfraniglesias.github.io on
Automate semantic versioning in git
I've just wrote a little command line tool to automate tags for semantic versioning in git.
You can see and download in the github repository, where you'll find full documentation.
versiontag looks for the last version tag in your project and updates it.
When you are ready for tagging, you only has to invokeversiontag
with the version level you want to update. And that's all. It would show you the current version, the new one, and will ask you for confirmation to add and to push it to the remote.
This is an example from the versioning ofversiontag , in which you can see all steps and details:
➜ versiontag git:(master) ./versiontag patch 'Add License'Current version : v1.0.1New tag : v1.0.2Do you agree? ([y]es or [N]o): yExecuting git tag -a v1.0.2 -m Add License (patch version) ...Tag v1.0.2 was created in local repository.Push it: git push origin v1.0.2Delete tag: git tag -d v1.0.2Do you want to push this tag right now? ([y]es or [N]o): yExecuting git push origin v1.0.2 ...Counting objects: 1, done.Writing objects: 100% (1/1), 179 bytes | 179.00 KiB/s, done.Total 1 (delta 0), reused 0 (delta 0)To https://github.com/franiglesias/versiontag * [new tag] v1.0.2 -> v1.0.2
Ideas and improvements will be welcome (specially get the last version tag from the remote and discriminate tags that are not version related).
HTH :-)
Top comments(5)

Try this one:gist.github.com/OleksandrKucherenk...

- Email
- LocationPrague
- Joined
Hey there, it actually got my attention and it looks interesting. I readed readme and code itself. I have few quick suggestions to improve.
- simple instalation (see mygithub.com/pkristian/mishell.sh )
- allow empty message
- add push param (something like —push, -p) to push without asking and what about do not asking if push?
- when wanting confirmation of new tag, just proceed when enter is pressed or take “y” as default option. take “n” for no ( or ctrl+c can be used)
- allow bypass confirmation by param —yes or -y
- i will try to treat it as regular linux utility, so using —params will be nice.

- LocationBarcelona
- Pronounshe/him
- WorkStaff Software Engineer @ Qualifyze
- Joined
Thank you for the suggestions, Patrik,
The over-confirmation issue ;-) comes from the fact that currently I cannot be certain about what kind/format of tag the tool will retrieve fromgit describe
, so I decided to ask before proceed. I think improving the tag detection from the beginning will help.
The idea of a --push or --force option is something I was starting to think about.
Well, this is a pet project of mine to learn something about shell scripting and git, so all suggestions are more than welcome. :-)

- Email
- LocationPrague
- Joined
I personally love git and bash, and making tool for that is something, what i highly support. I think, once it is done, it will be nice package to have. I think, when you are your own user, project is good to go.
If you will be interested, it will be nice to "exchange" improve our bash-git repos. :)
If you want, please look at mymishell.sh, send PR, open issue, whatever. :)
Happy bashing! :)

- LocationBarcelona
- Pronounshe/him
- WorkStaff Software Engineer @ Qualifyze
- Joined
Sure, I'll do. :-)
For further actions, you may consider blocking this person and/orreporting abuse