git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 8, 2007, 10:33 UTC
Message-ID
<7vfy52ka63.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070608102113.GB2335@cip.informatik.uni-erlangen.de>
Thomas Glanzmann <thomas@glanzmann.de> writes:
> I see it. Last line. I tried to clone from a repository which itself had a
> detached HEAD. Could that be the problem?
Ah, our mails crossed.

There is no reason to forbid cloning of a repository whose HEAD is detached, but detached HEAD is a relatively recent invention, and I would not be surprised if that was indeed the breakage, nor nobody has hit this so far.

It's sufficiently late here so I do not think I would be able to take a look at it tonight, though. Sorry.

Just in case you need unblocking (although I think you know how already), you should be able to continue with:

	$ git rev-parse v2.6.20^0 >.git/HEAD
        $ git read-tree HEAD
        $ git checkout-index -f -q -u -a

That would give you a normal detached state at v2.6.20; you should be able to come back to your branches with usual "git checkout".

Previous: Thomas GlanzmannNext: Thomas Glanzmann
Message 4 of 7 in “fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.”
  1. Thomas GlanzmannJun 8, 2007
  2. Junio C HamanoJun 8, 2007
  3. Thomas GlanzmannJun 8, 2007
  4. Junio C HamanoJun 8, 2007
  5. Thomas GlanzmannJun 8, 2007
  6. Junio C HamanoJun 8, 2007
  7. carbonated beverageJun 10, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.