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

Re: --orphan erases HEAD reflog

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Jun 3, 2016, 20:38 UTC
Message-ID
<20160603203818.7654-1-szeder@ira.uka.de>
In-Reply-To
<f51f9df7-d6d7-3a45-736f-ca2e2c9eb2cb@textalk.se>
Show 6 quoted lines
> after running the command:
> 
> git checkout --orphan fuleFix
> 
> my HEAD reflog is emptied.
> I would like to have my reflog intact :)

No worries, your reflog is still intact :) It's just the reflog walker stopping prematurely upon encountering the null sha1 of the new root commit's reflog entry. Patch follows in a minute.

Of course you still won't be able to list the reflog right after 'git checkout --orphan', because HEAD is invalid. You have to create a new root commit or switch to an existing branch first.

Gábor
Previous: Patrik GustafssonNext: SZEDER Gábor
Message 2 of 4 in “--orphan erases HEAD reflog”
  1. Patrik GustafssonJun 3, 2016
  2. SZEDER GáborJun 3, 2016
  3. reflog: continue walking the reflog past root commitsSZEDER Gábor, Jun 3, 2016
  4. Eric SunshineJun 4, 2016

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.