Fixing an ‘Ambiguous Head’ in Git

Git is great, but sometimes I feel you can shoot yourself in the foot with it when you don’t even know you’re holding a gun. If you are getting this message from git:

warning: refname 'HEAD' is ambiguous.

Try running git show-ref. In my case I had a local tag I created by accident named ‘head’. That’s what confusing command line options get you I suppose.



Filed under git

3 responses to “Fixing an ‘Ambiguous Head’ in Git

  1. Nick

    That’s all well and good, but how do you fix it?

  2. Actually, that will delete a branch named HEAD. You probably want…

    `git tag –delete HEAD`

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s