Created
March 21, 2018 14:40
-
-
Save mateuschmitz/dfefd712d89d7ec1f4af8dc3cbfb2409 to your computer and use it in GitHub Desktop.
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 | |
for DIR in */ ; do | |
if [ -d "$DIR/.git" ]; then | |
cd $DIR | |
BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
echo "Atualizando: "$DIR "("$BRANCH")" | |
echo "====================================================" | |
git pull origin $BRANCH | |
git fetch --all | |
cd ../ | |
echo -e "\n" | |
else | |
for DIR1 in $DIR/* ; do | |
if [ -d "$DIR1/.git" ]; then | |
cd $DIR1 | |
BRANCH=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
echo "Atualizando: "$DIR1 "("$BRANCH")" | |
echo "====================================================" | |
git pull origin $BRANCH | |
git fetch --all | |
cd ../../ | |
echo -e "\n" | |
fi | |
done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment