5

Running the command git ls-remote lists the following entries:

e6c1ddea6ee8eefa9e96e349dd4fad4a48c16448    refs/tags/1.1
1a3b5ae3a50ca2f24e5cd917cbf51d371f1dd01e    refs/tags/1.1^{}
81901877c5add523cd4a4bb8f51ad3bbbacbd686    refs/tags/1.2
4681b1ae6ec71301019da13d1790c2f808c2c553    refs/tags/1.2^{}

What does the ^{} mean in the output?

axiopisty
  • 4,972
  • 8
  • 44
  • 73
  • http://schacon.github.io/git/gitrevisions.html - A suffix ^ followed by an empty brace pair means the object could be a tag, and dereference the tag recursively until a non-tag object is found. – Mike B Oct 21 '13 at 20:09
  • 4
    See the answers to these questions: - http://stackoverflow.com/questions/12938972/what-does-mean-in-git - http://stackoverflow.com/questions/15472107/when-listing-git-ls-remote-why-theres-after-the-tag-name – Mattias Oct 21 '13 at 20:11
  • possible duplicate of [Duplicated tag on remote?](http://stackoverflow.com/questions/18510642/duplicated-tag-on-remote) – talles Oct 21 '13 at 21:07

1 Answers1

5

They are not part of the name, but rather an indicator to git rev-parse that it should dereference a tag (and, with any luck, find a commit, although in theory the tag could point to another tag, or even a tree or blob; but if it points to another tag, the ^{} keeps on peeling the onion layers until it hits a non-tag).

git ls-remote (or really, the remote itself) uses this syntax to send you the commit-ID. (I'm not quite sure what happens if the tag ultimately points to a tree or blob.)

torek
  • 448,244
  • 59
  • 642
  • 775
  • Do you know why git has both the 1.x and the 1.x^{} items? – axiopisty Oct 21 '13 at 20:13
  • 4
    Because it's an annotated tag, so `refs/tags/1.1` (or more precisely, `e6c1dde...`) is the tag object. The remote wants (rather helpfully) to get you the commit ID, so you can tell if you have the commit already. – torek Oct 21 '13 at 20:15