Last active
June 19, 2017 07:24
-
-
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
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
#!/bin/bash | |
# | |
# Recursively git pull on repos. | |
# Made by Zylla - [email protected] | |
# | |
# 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