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

Re: Cloning a remote tag without using git-fetch-pack directly?

From
Jeff King <peff@peff.net>
Date
Apr 20, 2011, 07:38 UTC
Message-ID
<20110420073805.GA2285@sigill.intra.peff.net>
In-Reply-To
<20110420072720.GC1790@feather>
On Wed, Apr 20, 2011 at 12:27:20AM -0700, Josh Triplett wrote:
Show 8 quoted lines
> Sadly, though, I still can't check out the result:
> 
> /tmp/linux-2.6$ git checkout FETCH_HEAD
> fatal: Cannot switch branch to a non-commit.
> (128) /tmp/linux-2.6$ git checkout -b master FETCH_HEAD
> fatal: Cannot switch branch to a non-commit.
> 
> I guess I'd hoped for something similar to "detached HEAD" mode.

No, it wouldn't make any sense to have a non-commit in HEAD, detached or otherwise, since you couldn't build commits on top of it (what would the new commit's parent pointer have in it?).

If you just want to check the files out into the working tree, you can do:

  git read-tree --reset -u FETCH_HEAD

But I'm not really clear on what you're trying to accomplish with all of this. If you can describe your ultimate goal, I might be able to help more.

-Peff
Previous: Josh TriplettNext: Jonathan Nieder
Message 4 of 5 in “Cloning a remote tag without using git-fetch-pack directly?”
  1. Josh TriplettApr 19, 2011
  2. Jeff KingApr 20, 2011
  3. Josh TriplettApr 20, 2011
  4. Jeff KingApr 20, 2011
  5. Jonathan NiederApr 20, 2011

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.