Created
July 10, 2014 09:24
-
-
Save temoto/e5922d1b5b299a9a5db2 to your computer and use it in GitHub Desktop.
Git rebase all branches onto origin/master
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
onto=origin/master | |
git fetch --prune | |
git branch --remotes --list 'origin/*' |grep -vE 'HEAD|master|gh-pages' |cut -d/ -f2 |while read -r b; do | |
printf "\nRebasing $b\n\n" | |
git checkout -B $b origin/$b | |
git rebase $onto && continue | |
git rebase --abort | |
git reset | |
git checkout . | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment