Skip to content

Instantly share code, notes, and snippets.

@meganemura
Last active December 25, 2015 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meganemura/7051938 to your computer and use it in GitHub Desktop.
Save meganemura/7051938 to your computer and use it in GitHub Desktop.
Update git branches
#!/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