Created
July 6, 2017 06:59
-
-
Save nkmathew/cc34c1826db29d725ed3d05db1b2c07d to your computer and use it in GitHub Desktop.
Git update all the repos in the current folder
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
#!/usr/bin/env bash | |
NC='\033[0m' # No Color | |
LYELLOW='\033[01;33m' | |
# Git update all the repos in the current folder | |
for folder in *; do | |
if [[ -d $folder ]]; then | |
cd $folder | |
if [[ -d ".git" ]]; then | |
url=$(git config --get remote.origin.url) | |
echo -e "\n${LYELLOW}Updating $url${NC}\n" | |
git pull --recurse-submodules --ff | |
fi | |
fi | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment