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

Re: Where is git checkout --orphan implemented at.

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 11, 2018, 17:35 UTC
Message-ID
<xmqqa7s1cjkj.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180605175435.GA22321@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 7 quoted lines
> If you don't even have symbolic-ref handy, you can do:
>
>   echo "ref: refs/heads/new-branch" >.git/HEAD
>
> That's not generally recommended, since future versions of Git may
> change the ref storage format, but it would work with any current
> version of Git.

Makes one wonder if it really "works" if .git/HEAD was created by older version of Git or in a repository where prefer-symlink-refs is enabled, though ;-)

Previous: Jeff KingNext: Jeff King
Message 3 of 4 in “Where is git checkout --orphan implemented at.”
  1. Sean HuntJun 5, 2018
  2. Jeff KingJun 5, 2018
  3. Junio C HamanoJun 11, 2018
  4. Jeff KingJun 11, 2018

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.