Last active
December 16, 2015 08:09
-
-
Save nvk/5404237 to your computer and use it in GitHub Desktop.
Compress git repos (git gc) recursively
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compress git repos (git gc) recursively | |
# Use as at will, by @nvk | |
gspace(){ | |
for gitdir in `find ./ -name .git`; | |
do | |
workdir=${gitdir%/*}; | |
hrline 44; # see http://gist.github.com/nvk/5340820 | |
echo $workdir; | |
git --git-dir=$gitdir --work-tree=$workdir gc --aggressive; | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a one liner:
find -name .git -execdir git gc --aggressive ";"
Even tho this one is fancier