Last active
August 9, 2017 14:40
-
-
Save vovayatsyuk/cc04dd59cb7997fbb7a0f568d6b6dc41 to your computer and use it in GitHub Desktop.
Update all git repositories in one command
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
cd folder/with/repos; | |
for module in *; do cd $module && git checkout master && git pull && cd ../; done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for module in *;
do
cd $module &&
git checkout master &&
git remote -v update origin &&
echo -n "Is run git pull (y/n)? "
read answer
if echo "$answer" | grep -iq "^y" ;then
git pull
fi &&
cd ../;
done;