I have to make a pull request to a repo.
I clone the project and it has only one branch :
Fixing via merge:
git fetch origin # gets latest changes made to master git checkout feature # switch to your feature branch git merge master # merge with master # resolve any merge conflicts here git push origin feature # push branch and update the pull request
Fixing via rebase:
git fetch origin # gets latest changes made to master git checkout feature # switch to your feature branch git rebase master # rebase your branch on master # complete the rebase, fix merge conflicts, etc. git push --force origin feature
Note carefully that the
--force option on the push after rebasing is probably required as the rebase effectively rewrites the
feature branch. This means that you need to overwrite your old branch in GitHub by force pushing.
Regardless of whether you do a merge or a rebase, afterwards the conflicts should be resolved and your reviewer should be able to complete the pull request.