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

Re: rebuild repo from data, packfiles?

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 21, 2010, 00:16 UTC
Message-ID
<20101121001643.GB27666@burratino>
In-Reply-To
<auto-000024044659@sci.utah.edu>
Hi Tom,
tom fogal wrote:
> Long story short, I lost some metadata in a repo I've got.  However,
> my entire .git/objects/ && subdirs is intact, so I'm hopeful my data's
> still accessible in some form.
Here's what I'd suggest.
 1. Backup what you have.
 2. git init newrepo
 3. rsync -a .git/refs .git/objects .git/packed-refs newrepo/.git/
 4. cd newrepo && git fsck --lost-found
See the repository-layout manual page[1] for details.

Hope that helps, Jonathan

[1] http://www.kernel.org/pub/software/scm/git/docs/gitrepository-layout.html
Previous: tom fogalNext: tom fogal
Message 2 of 7 in “rebuild repo from data, packfiles?”
  1. tom fogalNov 20, 2010
  2. Jonathan NiederNov 21, 2010
  3. tom fogalNov 21, 2010
  4. Jonathan NiederNov 21, 2010
  5. tom fogalNov 21, 2010
  6. Jonathan NiederNov 21, 2010
  7. tom fogalNov 21, 2010

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.