0

I made a mistake in a pull request and created a conflict in one of my files. Rather than follow github's instructions for hand-merging we'd still like to do this via the github UI. Keeps our review workflow consistent that way.

What I'd like to try is rebasing my branch against master, then force pushing the changes to my branch on my fork (no one's touched it except me) but I'm a little new to rebasing and am not sure how to go about it.

Essentially, I have branch my_branch on my_fork that I want to get into origin master. My pull request from my_branch\my_fork has a conflict (I know what the trouble is) that's preventing it from merging.

What I don't know is how to rebase my branch against master, what happens when I reach the commit with the conflict, what to do after I solve the conflict (isn't there a rebase continue option?) Any step by steps would be very much appreciated.

jkj2000
  • 1,563
  • 4
  • 19
  • 26

1 Answers1

0

Since you have pushed the branch you want to merge, you can mess around with rebase and start over again if you mess up. Also, you can try merging the branch into your master branch locally, and if it works you just reset your local master branch one commit and push the feature branch and do the same merge on GitHub.

When you do the rebase, if there is no conflict the rebase completes fully. If there is a conflict, you can either continue or abort. To continue you just resolve the conflicts, add the files to the index and continue, the same as for a merge. Then you solve the next conflict the same way if there are any.

So basically like this:

git checkout my_branch
git rebase master
# conflict happens here, resolved in your preferred way
git add -A
git rebase --continue
nixlarfs
  • 106
  • 8