git repack (was: Re: Mokomakefile error: fatal: Fetch failure: git://

Cesar Eduardo Barros cesarb at
Sat Aug 9 14:20:21 CEST 2008

Joachim Steiger escreveu:
> should be fixed now.
> i dunno exactly what the problem was, but i restarted git-daemon and gitweb.
> then i ran git-repack on the repos.
> seems fine again.
> also the repos got much smaller, which i hope is a good sign.
> when nobody has anything bad to note about this i would like to add a
> weekly cron which does this:
> see also

I would recommend "git gc" instead, which not only does a "git repack -a 
-d -l", but also cleans up some other stuff.

Another option would be running "git gc --auto" often; it does nothing 
until there are over 6700 loose objects, which it then packs on a new 
pack, and it condenses all packs into one (like "git repack -a -d -l") 
when there are over 50 packs (both values are configurable). Since it's 
much more lightweight (except when it decides to do a full repack), it 
can be run very often (and in fact some commands run it automatically).

And, as a comment in the blog post said, using "git count-objects" is 
better than "find objects | cut -d/ -f3 | wc -w" (but if you are using 
that, "git gc --auto" is usually better).

Cesar Eduardo Barros
cesarb at
cesar.barros at

More information about the devel mailing list