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