If you’re like me and have hundreds of local git repositories on your drive it is a real pain to keep them all compact. So time for another neat CLI command.
Add the lines below to
chmod +x it) or whichever you prefer and simply run
gitgc to recurse all directories from your current path and automagically garbage collect all repositories it finds.
It even accepts commandline options, so you can do
gitgc --aggressive to really clean up your repos.
Tested on Ubuntu Server 14.04 and OSX 10.9.3.