Created
October 4, 2018 12:13
-
-
Save SukkaW/0654afabd4ae793d82fd6d9b09d79be3 to your computer and use it in GitHub Desktop.
在所有子目录中的 git repo 里执行 git pull 和 git gc
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
#!/bin/bash | |
find `pwd` -type d -name ".git" > git_dir.txt | |
sed -i "s/\/.git/\//g" git_dir.txt | |
while read LINE | |
do | |
echo $LINE | |
cd "$LINE" | |
git pull | |
git gc | |
done < git_dir.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment