Skip to content

Instantly share code, notes, and snippets.

@mrousavy
Created June 16, 2017 07:53
Show Gist options
  • Save mrousavy/0d2564579f952a013219bec9d683d171 to your computer and use it in GitHub Desktop.
Save mrousavy/0d2564579f952a013219bec9d683d171 to your computer and use it in GitHub Desktop.
Pull for every subfolder
# Console Colors (Green, NoColor)
GREEN='\033[0;32m'
NC='\033[0m'
# Loop over all Directories
for path in *; do
[ -d "${path}" ] || continue # if not a directory, skip
dirname="$(basename "${path}")"
cd $dirname # Go into Directory
printf "${GREEN}$dirname: ${NC}"
git pull # Pull from github
cd .. # Go back to base directory
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment