Reputation: 602
I have a few branches locally and want to update them. How to merge the stuff from master branch into all other branches?
Upvotes: 1
Views: 706
Reputation: 246807
Assuming that you branched off of master:
git checkout my_branch
git rebase master
Upvotes: 0
Reputation: 602
#!/bin/bash
git checkout master
git pull
branches=()
eval "$(git for-each-ref --shell --format='branches+=(%(refname))' refs/heads/)"
for branch in "${branches[@]}"; do
branch=`expr substr $branch 12 100`
git checkout $branch
git merge master
done
git checkout master
Upvotes: 1