Created
April 18, 2012 13:07
-
-
Save steinim/2413447 to your computer and use it in GitHub Desktop.
Git garbage collection script
This file contains hidden or 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
#!/bin/bash | |
repo_dirs=$( ls -d1 $@ ) | |
for repo_dir in ${repo_dirs[@]} | |
do | |
cd $repo_dir | |
echo "checking if $repo_dir is a git repo" | |
if [[ -d .git ]] | |
then | |
echo "Garbage collecting $repo_dir" | |
git gc | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment