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

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

From
Jeff King <peff@peff.net>
Date
Jun 11, 2018, 21:09 UTC
Message-ID
<20180611210938.GA26235@sigill.intra.peff.net>
In-Reply-To
<xmqqa7s1cjkj.fsf@gitster-ct.c.googlers.com>
On Mon, Jun 11, 2018 at 10:35:40AM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > 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 ;-)
Heh, true. I guess "rm -f .git/HEAD" before would "fix" it.
-Peff
Previous: Junio C Hamano
Message 4 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.