From: Jonathan Nieder Date: Sun, 21 Nov 2010 00:16:48 GMT Subject: Re: rebuild repo from data, packfiles? Message-ID: <20101121001643.GB27666@burratino> In-Reply-To: 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