##########
cd $DIRNAME
+### xxx ideally we should not need to git checkout anything
+# which would in addition remove the need for a non-bare repo
+# this would take a bit more time though
+
+# make sure we keep track of the current branch upon exit
+function current_branch () {
+ git branch | grep '^\*' | cut -d' ' -f2
+}
+
function all_branches () {
remote=$1; shift
git branch -r | grep $remote | fgrep -v -- '->' | sed "s/.*\///g"
function git_update () {
+ current_branch=$(current_branch)
echo Running $COMMAND
remote=origin
for branch in $(all_branches $remote); do
git checkout $branch
git merge --ff $remote/$branch
done
+ git checkout $current_branch
}
git_update >& .git-update.log