Created
July 12, 2009 17:43
-
-
Save leontiy/145700 to your computer and use it in GitHub Desktop.
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 | |
USAGE="usage: git-gc-all [repositories_directory]" | |
if [[ -z $1 ]]; then | |
wd=`pwd` | |
elif [[ $1 == "--help" ]]; then | |
echo "runs git-gc in each subdirectory of current directory." | |
echo $USAGE | |
exit | |
else | |
wd=$1 | |
fi | |
echo Optimizing repositories in $wd: | |
pushd $wd | |
for repo in `ls`; do | |
echo "****************************************" | |
echo " $repo" | |
echo "****************************************" | |
pushd $repo | |
git-gc > /dev/null | |
popd | |
done | |
popd | |
echo | |
echo "Optimization complete." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment