From: Simon Ruderich Date: Tue, 30 Mar 2010 22:23:18 +0000 (+0200) Subject: update.sh: Add, updates git repositories. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=5e5cf75a2f998b6183c6c18a27b9022fc6d8de5e;p=config%2Fdotfiles.git update.sh: Add, updates git repositories. --- diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..d6a1b4d --- /dev/null +++ b/update.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# Update all git repositories to the latest available changes. This should be +# run on remote servers after new commits where pushed to them. + + +pwd=`pwd` +for path in `find . -name .git -type d`; do + cd $path; cd .. + + # Merge all branches into master if it's checked out. Then run ./setup.sh + # to make sure all configuration files get updated. + if `git branch | grep *\ master > /dev/null`; then + echo $path: + for branch in `git branch -a | grep remotes`; do + echo " merging: $branch" + git merge $branch + done + echo " running ./setup.sh" + ./setup.sh > /dev/null || exit 1 + fi + + cd $pwd +done