CURRENT_WORK_BRANCH = shift # Save current master's commits git checkout master # git checkout -b new-master git checkout master git remote add upstream https://github.com/dogtagpki/jss.git # Sync upstream git checkout master git fetch upstream # Reset current master state # OPTIONAL # # git reset --hard upstream/master # git push --force # Then, checkout your PR branch and rebase off of master git checkout $CURRENT_WORK_BRANCH git rebase -i upstream/master # # git push --force ------------------------------------------------------------- Repeat for the other PR's once current one is committed. I might need to resync master if there are other commits. # NEXT_PLULL_REQUEST