Last Updated: February 25, 2016
·
1.296K
· pietervogelaar

Get the highest semantic versioning tag in a GIT repository

By default the command "git tag" shows all tags of a repository, but sorted alphabetically. So if you have tags like "0.1.0", "0.9.0" and "0.10.0", they will be in the order:

0.1.0
0.10.0
0.9.0

To get the highest semantic versioning tag, use this short but very powerful command:

git tag | sort -r --version-sort | head -n1