1. Pretext
  2. Howto
  3. Note
  4. Related stuff

Pretext

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.

Howto

Add the lines below to ~/bin/gitgc (and 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.

Note

Tested on Ubuntu Server 14.04 and OSX 10.9.3.

git gc documentation

 

Buy me a coffee