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

Re: Objects deleted before first commit

From
David Barr <davidbarr@google.com>
Date
Jun 14, 2011, 12:57 UTC
Message-ID
<BANLkTikSPNVbGFRUVh5eSFsxabVWT7SVVA@mail.gmail.com>
In-Reply-To
<8269100C7056D24A91B672AF7E5E48492D959E@exchange.GottexBrokers.local>

On Tue, Jun 14, 2011 at 10:43 PM, Edmondo Porcu <Edmondo.Porcu@gottexbrokers.com> wrote:

> I have created a git repository, and then I have deleted by error some files with rm -rf .
> Now the files have disappeared from the hard disk, I am desperately looking on how to restore them. The objects folder is full of dangling objects, but I do not know how to recover them.

If you did use 'git add' to stage your work before the unfortunate invocation of rm, the blobs should be accessible.

Something like the following might work: git show `cd .git/objects; ls ??/* | tr -d /`

This will pretty print all loose objects. -- David Barr.

Previous: Edmondo PorcuNext: Edmondo Porcu
Message 2 of 10 in “Objects deleted before first commit”
  1. Edmondo PorcuJun 14, 2011
  2. David BarrJun 14, 2011
  3. Edmondo PorcuJun 14, 2011
  4. David BarrJun 14, 2011
  5. PJ WeisbergJun 14, 2011
  6. Edmondo PorcuJun 14, 2011
  7. Carlos Martín NietoJun 14, 2011
  8. PJ WeisbergJun 14, 2011
  9. Edmondo PorcuJun 14, 2011
  10. Tomas CarneckyJun 16, 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.