Created
October 24, 2011 19:16
-
-
Save a2/1309879 to your computer and use it in GitHub Desktop.
Git pull in all subdirectories if directory is repo
This file contains hidden or 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
for f in *; | |
do | |
echo "$f"; | |
if [ -d "$f" ]; | |
then | |
cd "$f"; | |
if [ -d ".git" ]; | |
then | |
git pull --all; | |
else | |
echo "Not a git repository..."; | |
fi; | |
cd ../; | |
else | |
echo "Not a directory..."; | |
fi | |
echo ""; | |
done |
This file contains hidden or 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
for f in *; do echo "$f"; if [ -d "$f" ]; then cd "$f"; if [ -d ".git" ]; then git pull --all; else echo "Not a git repository..."; fi; cd ../; else echo "Not a directory..."; fi echo ""; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment