Weird git ls-remote output

Issue #7798 invalid
Nathan Delhaye
created an issue


When i'm doing a "git ls-remote" the last line contain weird characters : ^{}

Example from github :

f0a7d6b6cf64f408601c1597064cea05835a5f61        HEAD
0b1bfe178869ba23a07cb118c362b29878b9a13e        refs/pull/1/head
a5a98d8deaef0d89e2b872dea45576ba835e159a        refs/pull/1/merge
94f75ca3ca6fd59e57aa44d997d138b4c6589900        refs/pull/9/head
13b657144cbe8329bd2eeb6330fed67f5a959899        refs/pull/9/merge

From bitbucket :

518b6e814081ad63d1c5710bcea6061a6d6a6f5d        HEAD
518b6e814081ad63d1c5710bcea6061a6d6a6f5d        refs/heads/master
68ccad6b2b9eadc4b54f441d5041c30e3bc091e7        refs/tags/1.0
518b6e814081ad63d1c5710bcea6061a6d6a6f5d        refs/tags/1.0^{}

The "^{}" shouldn't be there.

This is a problem for automated-deployment tools like capistrano.

Comments (4)

  1. Erik van Zijst staff

    That ^{} is there because:

    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.

    I suspect you'll see the same thing if you push your repo (including all its tags!) to GitHub. The refs in your first example are all github-created pullrequest refs, which are most likely symbolic refs.

  2. Log in to comment