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

Re: Bug: Pulling remotes into an empty repo deletes the index

From
AAAdam A <hitsthings@gmail.com>
Date
Aug 3, 2013, 21:46 UTC
Message-ID
<CAJOTJ-D6Aho_NJscXtu74Ok7u5sQmHn_L_Nma_F1kn9O6y95UQ@mail.gmail.com>
In-Reply-To
<20130803165728.GB2893@elie.Belkin>
On Sun, Aug 4, 2013 at 2:57 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 12 quoted lines
> Daniel Convissor wrote:
>
>> All is not lost.  Your local files should be stored in the repository's
>> reflog.  Examine the output of "git reflog".  You can then reset your
>> working directory to obtain those files by doing something _like_
>> "git reset --hard HEAD@{1}".
>
> Adam hadn't made a commit, so that wouldn't work in this case.
>
> "git fsck --lost-found" should be helpful, but yeah, this is a bug.
> See for example [1] for the start of a patch to play with (needs
> tests).

Ah I didn't realize the objects would still be there! `git fsck` + `git show` is a wonderful workaround until the bug is fixed.

Show 5 quoted lines
>
> Thanks and hope that helps,
> Jonathan
>
> [1] http://thread.gmane.org/gmane.comp.version-control.git/196502/focus=196503

Thanks so much guys! Adam

Previous: Daniel ConvissorNext: Jeff King
Message 5 of 7 in “Re: Bug: Pulling remotes into an empty repo deletes the index”
  1. Adam AAug 3, 2013
  2. Daniel ConvissorAug 3, 2013
  3. Jonathan NiederAug 3, 2013
  4. Daniel ConvissorAug 3, 2013
  5. Adam AAug 3, 2013
  6. Jeff KingAug 10, 2013
  7. Daniel ConvissorAug 3, 2013

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.