Skip to content

Instantly share code, notes, and snippets.

@adde88
Last active June 19, 2017 07:24
Show Gist options
  • Save adde88/c097c34071284a67630e99e359e4ce7c to your computer and use it in GitHub Desktop.
Save adde88/c097c34071284a67630e99e359e4ce7c to your computer and use it in GitHub Desktop.
Git Pull - Will scan sub-folders for a git repo. and then uses git pull on everyone to keep them updated
#!/bin/bash
#
# Recursively git pull on repos.
# Made by Zylla - adde88@gmail.com
#
# This script will search your current folder recursively for git repositories, and then execute: "git pull" on those repos. to keep them up to date
# I've been using this script inside my World of Warcraft AddOns folder, to keep some private AddOns up-to date.
#
# So i've placed this script inside my "World Of Warcraft/Interface/AddOns" folder
#
CDIR="$(pwd)"
xGIT=`ls -aR | grep : | grep .git | awk 'BEGIN{FS="/"} {print $2}' | sort | uniq`
echo -e "Starting a recursively git-pull on all sub-folders."
for i in $xGIT; do
DIR=./$i
cd "$DIR"
git pull
cd "$CDIR"
done
echo -e "Finished..."
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment