I was running out of storage space on my machine, so I started to search for things to remove using Grand Perspective. Some of the big files were inside Git repositories, or rather, inside the .git directory of those repositories. I decided it was time to run the Git garbage collector on them, all of them.

I wrote this little script:

#!/usr/bin/env bash

echo "Gitgcing $1"
cd "$1"

and with this line:

find . -name ".git" -type d -exec gitgc "{}" ";"

run in my home directory, I got all my repos gc’ed.


Share:


Comments

One response to “Git-gc'ing all git repositories”

  1. […] after a post I found here. Related Posts:Quick and Easy PHP WHOIS ScriptAutomatic JS Broken Image ReplacementCreating a […]

Leave a Reply

Your email address will not be published. Required fields are marked *