If you need a one liner which gets the latest tag name (by tag date) on the current branch:
git for-each-ref refs/tags --sort=-taggerdate --format=%(refname:short) --count=1 --points-at=HEAD
We use this to set the version number in the setup.
Output example:
v1.0.0
Works on Windows, too.