Here is the man page for git show-ref -d . They also have an example at the bottom. Still I am not able to understand what dereference does?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Git, a "normal" (annotated, not lightweight) tag is an object unto itself, containing metadata and the SHA1 of the object it tags. Chapter 10.2 Git Internals – Git Objects in the Git community book has an illustration of the object model:
Legend: yellow – commit object, blue/green – tree object, white – blob object
So, when you use
git show-refon a normal tag, it will normally give you information about the tag object. With the-d/--dereferenceoption, it will dereference the tag into the object the tag refers to, and provide information about it instead.And a note on lightweight vs. annotated tags, in case you aren’t aware of that: a lightweight tag is created by using
git tag <tag name>(i.e. without any of the metadata-providing options like-a,-s, or-u). It’s not a tag object at all, just a Git reference pointing straight to the object you’ve tagged. If you provide one of those options, you’re attaching metadata to the tag, so Git creates a tag object to hold that.