Created
October 29, 2015 16:55
-
-
Save Und3rf10w/7fbe4cac7a25d2d12f7f to your computer and use it in GitHub Desktop.
Automatically updates all git repos within a directory. Great for manaing a large collection of tools installed in something like /opt
This file contains 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
for repo in $(ls -l |grep dr |awk {'print $9'}); do | |
cd $repo; | |
if [ -d ".git" ]; then | |
echo "Attempting to update $repo"| logger | |
git pull; | |
if [ $? -ne 0 ]; then | |
echo "Error attempting to update $repo" 1> >(logger -s 2>> /opt/repoupdate.err) | |
fi; | |
fi; | |
cd ..; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment