Skip to content

Instantly share code, notes, and snippets.

@senechaux
Created October 3, 2018 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save senechaux/632790cbdc6c4d95fd30464a90f8e699 to your computer and use it in GitHub Desktop.
Save senechaux/632790cbdc6c4d95fd30464a90f8e699 to your computer and use it in GitHub Desktop.
Git pull all subdirectories in current directory
#!/bin/bash
DIRS=`ls -d */`
for dir in ${DIRS[@]}; do
cd $dir
if [ -d .git ]; then
echo '=================='
echo '=================='
echo $dir
echo '=================='
echo '=================='
git co master
git pull
git co -
git co dev
git pull
git co -
fi;
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment