Skip to content

Instantly share code, notes, and snippets.

@nkmathew
Created July 6, 2017 06:59
Show Gist options
  • Save nkmathew/cc34c1826db29d725ed3d05db1b2c07d to your computer and use it in GitHub Desktop.
Save nkmathew/cc34c1826db29d725ed3d05db1b2c07d to your computer and use it in GitHub Desktop.
Git update all the repos in the current folder
#!/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