From: Philip Oakley Date: Tue, 10 Jan 2012 21:33:44 GMT Subject: Re: rsync a *bunch* of git repos Message-ID: <25207BDC675840DEA94AA2B04D6783BD@PhilipOakley> In-Reply-To: <201201102124.q0ALOowL026941@no.baka.org> From: "Seth Robertson" Sent: Tuesday, January 10, 2012 9:24 PM > In message <20120110211548.GD10255@titan.lakedaemon.net>, Jason writes: > > The nuts and bolts of this aren't difficult, the problem is I don't > have > a complete understanding of how git stores data. I've heard in the > past that it uses a lot of hardlinks and softlinks. I need to make > sure, that once I transfer the data, and reboot the machine with the > new > partition mounted under /home, that all my git repos will be okay. > > Under most circumstances, git will do the right thing. Only if you > use specific flags on clone (like --shared or --reference) might > something go wrong, and as the manual page explains, you can use > git-repack to undo these. I think there is an exception for certain git submodule setups with local repos, where the gitdir link is hard coded to the absolute machine path. There has been some discussion on the list recently about trying to cover this case. > > The real solution is, after you rsync, to: > > for f in */.git; do (cd $f; git fsck >&/dev/null || echo "$f is BAD!!"); > done > > If you get no output, you should be golden. If you get output, check > to make sure the repo you are copying from is good as well. > > -Seth Robertson