Re: determine name of tag used for checkout when multiple tags exist?
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Sep 4, 2015, 04:59 UTC
- Message-ID
- <CA+P7+xo8BM1hCnkh3pa65eF=qne3yybTBCoBY3mqm8FfzwdShg@mail.gmail.com>
- In-Reply-To
- <CAL3By-8odLE53iBiNATgiCcnK4Ef5uBeH7E6EMB1K7P-oX0oAQ@mail.gmail.com>
On Thu, Sep 3, 2015 at 7:53 PM, Jesse Hopkins <jesse.hops@gmail.com> wrote:
Show 7 quoted lines
> > It seems to me that when checking out to a tag, Git does not record the > *name* of the tag anywhere, but rather sets HEAD to the de-referenced > commit SHA-1. As far as I can tell, it is not possible to recover the > original name of the tag in the case of multiple tags on the same commit. > Is my conclusion correct? >
I believe you are correct unless you check out to a branch named after the tag? I don't believe it will actually store the tag as part of its checkout.
Ie:
git checkout <tag>
may show "checked out at <tag>" via status, but that is only because status uses describe to find that out..
I don't believe we store the information. You could recover it if you know something about the format so as to distinquish them, ie: if you only cared about annotated tags vs lightweight tags, for example.
Regards, Jake