Git tag, Why this duplicate tag in remotes?

There are two types of tags in Git: “lightweight” and “annotated”.

Lightweight tags are simply refs in the refs/tags/ namespace that point to some other object. They are created by using git tag <tagname> [object] without -a, -m, -F, -s, or -u.

Annotated tags are actually a separate kind of Git object (a tag object) that point to some other object. Tag objects store committer information, author information, a message (similar to commit objects) and they point to any single other object (different from commit objects in that commits point to exactly one tree object and zero or more other commit objects).

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.

Normally, both kinds of tags point to commits, but they can point to any kind of Git object (tag, commit, tree, or blob). The git.git repository has refs/tags/junio-gpg-pub that points to a blob that contains the maintainer’s GPG public key. Also, torvalds/linux-2.6.git has refs/tags/v2.6.11 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.


The syntax ^{} suffix (described in gitrevisions(7)) 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 ^{} suffix.

The refs/tags/Prod_Release_2.3 ref in your central repository points to the tag object named 30bd19ef190cf664356c715b56044ce739f07468.
That tag objects ultimately points to some other non-tag object named 4ae15ee04c2c41bfc7945e66f4effc746d52baec (probably a commit).

Thus, refs/tags/Prod_Release_2.3^{} resolves to 4ae15ee04c2c41bfc7945e66f4effc746d52baec.

Leave a Comment