#!/bin/sh

die() {
   echo Failed - stopping
   exit 1
}

for br in $(git branch --list | grep -v master | sed 's/\*//' ) ; do
   [ -n "$br" ] && {
      echo On branch: $br
      git checkout $br || die
      git pull
      git merge master -m "Merge master branch"
   }
done

echo Checking out master 
git checkout master


#!/bin/sh

die() {
   echo Failed - stopping
   exit 1
}

echo Fetching from origin
git fetch origin
for br in $(git branch --list | grep -v master | sed 's/\*//' ) ; do
   [ -n "$br" ] && {
      git checkout $br || die
      echo -n "Merge origin/$br " ; git merge origin/$br
      echo -n "Merge master " ; git merge master -m "Merge master branch"
   }
done

echo Checking out master 
git checkout master


Speed up merge script: Only one network fetch
Speed up merge script: Only one network fetch
