I'm doing
$ git tag
current
tag_example_to_test_task
$ git checkout tag_example_to_test_task
...
HEAD is now at 75fdde3... commit comment text example
$ git name-rev --name-only --tags HEAD
current
$ git describe --exact-match --tags
current
I need to end execution sequence with some command like this:
$ git "some command here"
tag_example_to_test_task
How to do that? How to get tag name of current checked out tag?
I think
git log -n 1 --pretty=format:'%d'
should do the trick.
However, it'll show you names of all branches and tags your current revision has. I don't think it's possible to get just the single tag that have been used to check out the revision.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With