]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - update.sh
d65bd69f2887fbedb0c945f313909a45b49bc85f
[config/dotfiles.git] / update.sh
1 #!/bin/sh
2
3 # Update all git repositories to the latest available changes. This should be
4 # run on remote servers after new commits where pushed to them.
5
6
7 pwd=`pwd`
8 for path in `find . -name .git -type d`; do
9     cd $path; cd ..
10
11     # Merge all branches into master if it's checked out. Then run ./setup.sh
12     # to make sure all configuration files get updated.
13     if `git branch | grep *\ master > /dev/null`; then
14         echo $path:
15         for branch in `git branch -r`; do
16             echo "  merging: $branch"
17             git merge $branch
18         done
19         echo "  running ./setup.sh"
20         ./setup.sh > /dev/null || exit 1
21     fi
22
23     cd $pwd
24 done