Last active
December 25, 2015 22:48
-
-
Save meganemura/7051938 to your computer and use it in GitHub Desktop.
Update git branches
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 | |
# pull origin | |
echo -ne "* " | |
git checkout master | |
git pull origin master | |
echo "" | |
branches=$(git branch | grep -v master) | |
for branch in $branches; do | |
echo -ne "* " | |
git rebase master $branch | |
echo "" | |
done | |
echo -ne "* " | |
git checkout master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment