Skip to content

Instantly share code, notes, and snippets.

@vovayatsyuk
Last active August 9, 2017 14:40
Show Gist options
  • Save vovayatsyuk/cc04dd59cb7997fbb7a0f568d6b6dc41 to your computer and use it in GitHub Desktop.
Save vovayatsyuk/cc04dd59cb7997fbb7a0f568d6b6dc41 to your computer and use it in GitHub Desktop.
Update all git repositories in one command
cd folder/with/repos;
for module in *; do cd $module && git checkout master && git pull && cd ../; done;
@0m3r
Copy link

0m3r commented Aug 9, 2017

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment