gittagsambiguitygit-refspec

warning: refname 'HEAD' is ambiguous - but no HEAD branch


I've been generating a few git repositories from CVS repositories using the crap tool (it's not crap!...)

Unfortunately, with one of them, and after the export, I keep getting complaints about HEAD being an ambiguous reference. I've read:

warning: refname 'HEAD' is ambiguous

but unlike in that case - I don't have a branch named HEAD. So, what's the cause of this ambiguity?


Solution

  • If it's not a branch, it could be a tag. Check this with:

    git --no-pager tag -l HEAD
    

    if it produces an output line with HEAD on it, then - that's your problem. Now, you can either:

    1. Rename the tag (difficult - since the instructions in here won't work due to the ambiguity), or
    2. Delete the tag, like so:
      git tag -d HEAD
      
      (See also this question on deleting tags.)