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:
This is an old thread, but it seems a lot of people are missing the simplest, easiest, and most correct answer to OP's question: to get the latest tag for the current branch, you use git describe HEAD
. Done.
Edit: you can also supply any valid refname, even remotes; i.e., git describe origin/master
will tell you the latest tag that can be reached from origin/master.