14

Got this error during cloning

remote: warning: refname '4e810d87701e09df2949cb33e731052aa05d2c76' is ambiguous.
remote: Git normally never creates a ref that ends with 40 hex characters
remote: because it will be ignored when you just specify 40-hex. These refs
remote: may be created by mistake. For example,
remote: 
remote:   git checkout -b $br $(git rev-parse ...)
remote: 
remote: where "$br" is somehow empty and a 40-hex ref is created. Please
remote: examine these refs and maybe delete them. Turn this message off by
remote: running "git config advice.objectNameWarning false"

2 Answers 2

14

During cloning I got this error message and found that a tag was created with this name (like a 40-hex ref).

When you get this error, you can look for branch or tag names with the ambiguous value and remove it if the ref is not required

$ git tag | grep 4e810d87701e09df2949cb33e731052aa05d2c76
4e810d87701e09df2949cb33e731052aa05d2c76

$ git tag -d 4e810d87701e09df2949cb33e731052aa05d2c76
1
  • 1
    It worked for me, just it was a branch instead of tag and I deleted it.
    – Ari
    Jun 8, 2015 at 20:20
8

In my case it was a branch and not a tag.

To find if the ref is a tag or branch:

$ git branch -a | grep 4e810d87701e09df2949cb33e731052aa05d2c76
$ git tag | grep 4e810d87701e09df2949cb33e731052aa05d2c76

Be aware you might want to save the branch or tag before you delete it. (Using a different name, of course.)

Here's how I got rid of it:

$ git branch -d 4e810d87701e09df2949cb33e731052aa05d2c76
$ git push origin :4e810d87701e09df2949cb33e731052aa05d2c76

In my case the error only came up during a git clone --mirror--it wasn't a problem normally.

1
  • I had the same problem, but this solution didn't work. The branch got deleted but the changes done in the branch was not pushed to master
    – Vivek
    Jun 4, 2020 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.