Created
November 4, 2018 07:45
-
-
Save sontqq/77439f74991fb4c6e99df7bd88f5f6df to your computer and use it in GitHub Desktop.
Update all cloned git repos in a single directory by a single 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
#!/bin/bash | |
CUR_DIR=$(pwd) | |
counter=0 | |
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
for i in $(find . -name ".git" | cut -c 3-); do | |
echo ""; | |
echo "\033[33m"+$i+"\033[0m"; | |
counter=$((counter+1)) | |
cd "$i"; | |
cd ..; | |
git pull origin master; | |
cd $CUR_DIR | |
done | |
echo "\n\033[32mComplete!\033[0m\n" | |
echo "$counter repos updated." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment