Skip to content

Instantly share code, notes, and snippets.

@anotheremily
Created March 2, 2017 14:57
Show Gist options
  • Save anotheremily/b150466cee8d3b6e79464ea8a8251f1f to your computer and use it in GitHub Desktop.
Save anotheremily/b150466cee8d3b6e79464ea8a8251f1f to your computer and use it in GitHub Desktop.
pullpushrebase.sh
BRANCH=`git symbolic-ref HEAD | sed 's!refs\/heads\/!!'`; \
git stash; \
git checkout master; \
git pull --rebase; \
git checkout $BRANCH; \
git rebase master; \
git pull --rebase; \
git push; \
git stash pop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment