Created
December 6, 2019 23:03
-
-
Save mikejgray/1145f924fab912ca90db580978daeff8 to your computer and use it in GitHub Desktop.
Run in a directory with multiple Git repos to pull down the latest version of remote code.
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 | |
################################################################################ | |
# Run in a directory with multiple Git repos to pull down the latest version | |
# of remote code. | |
################################################################################ | |
shopt -s nullglob | |
array=(*/) | |
for dir in "${array[@]}"; do | |
if [ -d "${dir}.git/" ]; then | |
cd ${dir} | |
echo "Pulling ${dir}..." | |
git checkout master && git pull | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment