Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are two types of tags in Git: “lightweight” and “annotated”.</p> <p>Lightweight tags are simply refs in the <code>refs/tags/</code> namespace that point to some other object. They are created by using <code>git tag &lt;tagname&gt; [object]</code> without <code>-a</code>, <code>-m</code>, <code>-F</code>, <code>-s</code>, or <code>-u</code>.</p> <p>Annotated tags are actually a separate kind of Git object (a <a href="http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html#def_tag_object">tag object</a>) that point to some other object. Tag objects store committer information, author information, a message (similar to <a href="http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html#def_commit_object">commit objects</a>) and they point to any single other object (different from commit objects in that commits point to exactly one <a href="http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html#def_tree_object">tree object</a> and zero or more other commit objects).</p> <p>When you have an annotated tag, you usually also have a ref that points to it. Technically this ref is itself a “lightweight” tag, but we usually do not describe them separately.</p> <p>Normally, both kinds of tags point to commits, but they can point to any kind of Git object (tag, commit, tree, or blob). The <a href="http://git.kernel.org/?p=git/git.git;a=summary"><code>git.git</code> repository</a> has <a href="http://git.kernel.org/?p=git/git.git;a=tag;h=6019c27d966fe3ce8adcc0e9f12078eef96ca6ef"><code>refs/tags/junio-gpg-pub</code></a> that points to a blob that contains the maintainer’s GPG public key. Also, <a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary"><code>torvalds/linux-2.6.git</code></a> has <a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=tag;h=5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c"><code>refs/tags/v2.6.11</code></a> that points to a tree. Although tags that point to non-commit objects are technically allowed, they may break or confuse some tools, so they should be avoided, if possible.</p> <hr> <p>The syntax <code>^{}</code> suffix (described in <a href="http://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html#_specifying_revisions"><em>gitrevisions(7)</em></a>) is the tag dereferencing syntax (sometimes called the “peeled tag” syntax). For tag objects, it evaluates to the first non-tag object to which the tag object points (it will recursively deference a chain of tag objects until it finds a non-tag object). For non-tag objects, it means the same thing as without the <code>^{}</code> suffix.</p> <p>The <code>refs/tags/Prod_Release_2.3</code> ref in your central repository points to the tag object named <code>30bd19ef190cf664356c715b56044ce739f07468</code>.<br> That tag objects ultimately points to some other non-tag object named <code>4ae15ee04c2c41bfc7945e66f4effc746d52baec</code> (probably a commit). </p> <p>Thus, <code>refs/tags/Prod_Release_2.3^{}</code> resolves to <code>4ae15ee04c2c41bfc7945e66f4effc746d52baec</code>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload