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:15 UTC
Message-ID
<7vodjqkazp.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070608100831.GA2335@cip.informatik.uni-erlangen.de>
Thomas Glanzmann <thomas@glanzmann.de> writes:
Show 13 quoted lines
> Hello,
>
>         (s017241) [/usr/src/linux-2.6] git checkout v2.6.20
>         warning: You appear to be on a branch yet to be born.
>         warning: Forcing checkout of v2.6.20.
>         fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
>         Use '--' to separate paths from revisions
>         Cannot detach HEAD
>
> (s017241) [/usr/src/linux-2.6] git version
> git version 1.5.2.1
>
> what is going wrong here?

Perhaps repository was set up in an unusual way by hand (i.e. not by a clone), such that:

 1. you have HEAD pointing at a branch (e.g. 'refs/heads/master'),
 2. which does _not_ exist yet (i.e. no 'refs/heads/master'),
 3. yet you have a tag that you can try to detach your HEAD to (e.g. v2.6.20).

... well that was my initial guess, but even after setting up such a funny repository by hand, I cannot seem to reproduce it.

Previous: Thomas GlanzmannNext: Thomas Glanzmann
Message 2 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.