Skip to content

Bolt Core Developer Branch Synchronisation Script

Gawain Lynch edited this page Apr 16, 2016 · 1 revision

Setting up a new local clone with bolt/bolt as an "upstream"

git clone git@github.YourGitHubName/bolt.git
git remote add upstream https://github.com/bolt/bolt.git

Bash script to synchronise branches:

git fetch --all

BRANCHES=$(git branch -a | grep -E "upstream/release/(2\.[2]|3)" | sed 's/remotes\/upstream\///g' | sort)

git fetch --all --prune

for rel in $BRANCHES ; do 
    git checkout $rel
    [[ $? -ne 0 ]] && exit 1

    git pull upstream $rel
    [[ $? -ne 0 ]] && exit 1

    git push 
    [[ $? -ne 0 ]] && exit 1

    git checkout master
done

if [ $BRANCH ] ; then
    git checkout $BRANCH
fi
Clone this wiki locally