Created
January 21, 2021 07:06
-
-
Save babvin/7c428ad26cb5806b5dd315ed530973b5 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 | |
# Set the root directory | |
CUR_DIR=/git/DTMS-Tools | |
cd $CUR_DIR | |
# Let the person running the script know what's going on. | |
echo -e "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" | |
# Find all git repositories and update it to the master revision | |
for i in $(find . -name "*.git" | cut -c 3-); do | |
repo=$(echo $i | awk -F/ '{ print $1 }'); | |
echo -e ""; | |
echo -e "\033[33m"+$repo+"\033[0m"; | |
# We have to go to the .git parent directory to call the pull command | |
cd "$i"; | |
cd ..; | |
git pull git@<your git repo path>/$repo master | |
cd $CUR_DIR | |
done | |
echo -e "\n\033[32mComplete!\033[0m\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment