What\'s the simplest way to get the most recent tag in Git?
git tag a HEAD
git tag b HEAD^^
git tag c HEAD^
git tag
output:
To get the most recent tag, you can do:
$ git for-each-ref refs/tags --sort=-taggerdate --format='%(refname)' --count=1
Of course, you can change the count argument or the sort field as desired. It appears that you may have meant to ask a slightly different question, but this does answer the question as I interpret it.