From: Andreas Krey Date: Wed, 14 Jan 2015 13:07:31 GMT Subject: Re: Big repo not shrinking on repack or gc? Message-ID: <20150114130731.GD13247@inner.h.apk.li> In-Reply-To: <20150114124936.GC30383@peff.net> On Wed, 14 Jan 2015 07:49:36 +0000, Jeff King wrote: > On Wed, Jan 14, 2015 at 12:51:30PM +0100, Andreas Krey wrote: > > > I have a repo here that is 130G, but when I clone --mirror it, the result > > is only 25G big. Because of the --mirror I don't think that I missed > > any refs that keep objects only in the source repo. > > Perhaps some objects are mentioned by reflogs, but not by the refs? They > would not be transferred as part of a clone. Try: > > git rev-list --objects --all | cut -d' ' -f1 | sort >reachable > git rev-list --objects --reflog | cut -d' ' -f1 | sort >reflogs Actually, the output of 'git rev-list --objects --reflog' is empty, and there isn't even a reflog (or similar) directory. (This is a bare repo inside atlass. stash.) ... > > I already tried 'git repack -fad' and 'git gc' to shrink the original repo, > > You don't need the "-f" here. Just "git repack -ad" should be enough > (and the "-f" probably makes it _way_ slower). Right, the -f is an old workaround for old jgits in another repo. Apparently, part of the trick is --prune=all or similar on 'git gc', to get rid of the loose objects faster. That got a copy of the repo down to around 70G - still way to go. Andreas -- "Totally trivial. Famous last words." From: Linus Torvalds Date: Fri, 22 Jan 2010 07:29:21 -0800