If there are multiple tags available in a Git project, how can we check, which is the checked out tag out of all the present ones.
git tag
will list all the tags, and entries will be present in .git/refs/tags
say for example: - today we did a repository sync from master repository and got tag 1 and we checkouted tag 1 and started working on it, few weeks later we synced the content and checked out new tag.
Now if I want to check the latest status, which is the current checked-out tag - how can we do this?
git describe
tells you the most recent tag that your working copy refers to.
Excerpt from the man page:
git-describe - Show the most recent tag that is reachable from a commit
Good answers here, but another, and sometimes friendlier way, is with gitk:
gitk --all
For any given commit, it will show you the nearest tags both before and after it, not to mention the graphical layout of the commit graph with tags and branches represented
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