I'm currently working with a repository that has multiple branches.
When I create a tag, does that tag refer to the then-current branch?
In other words: Whenever I create a tag, do I need to switch to the desired branch and tag inside that branch so that the tag refers to that branch at that point in time?
CharlesB's answer and helmbert's answer are both helpful, but it took me a while to understand them. Here's another way of putting it:
git show <tag>
to see a tag's details contains no reference to any branches, only the ID of the commit that the tag points to.
6f6b5997506d48fc6267b0b60c3f0261b6afe7a2
)git tag v0.1.0 # tags HEAD of *current* branch
git tag v0.1.0 develop # tags HEAD of 'develop' branch
git describe
to describe the current branch:
git describe [--tags]
describes the current branch in terms of the commits since the most recent [possibly lightweight] tag in this branch's history.git describe
may NOT reflect the most recently created tag overall.