#!/bin/bash ## note the "*" output for current branch in `git branch` ## the following records all branches except the current one: ## git branch | grep -v '*' >branches BRANCHES=`cat branches` REF=perso/tschoute REPO=buildserver:ecos_trailer push () { BRANCH=$1 echo PUSH $BRANCH git checkout $BRANCH git push $REPO HEAD:$REF/$BRANCH } link () { BRANCH=$1 echo LINK $BRANCH echo git config branch.$BRANCH.remote origin echo git config branch.$BRANCH.merge refs/heads/$REF/$BRANCH } for b in $BRANCHES; do \ push $b link $b done