The dreaded merge conflict. Here's how to solve them. Written from a Windows and VS Code perspective.
Rebasing a GitHub pull request
Ugh. What a nightmare.
Update with merge commit
This is probably the way to go. Force pushing makes it so that I can't check out the PR with VS Code's GitHub extension.
Option 1
- repo -> ... -> Settings -> General -> tick "Always suggest updating pull request branches"
- Go back to the PR.
- At the bottom, next to the button that says "Update branch", click the down arrow
- Select "Update with merge commit"
- Click "Update branch"
Obsolete and buggy. Suggest using "update with merge commit", option 1 |
---|
The following discussion has been closed. Please do not modify it. |
Option 2TODO: There's probably a manual way to do this. Update with rebaseVS Code's GitHub extension does not handle rebasing a GitHub PR at all. Should do "Update with merge commit" above instead. Option 1
Option 2I did a lot of Googling and trying things, none of it worked. Finally, Taavi gave me a workflow to use in the command line that works.
|
Rebasing a Gerrit patch
Much easier.
- Simple rebases can be handled by navigating to the webpage of the patch, then clicking the "Rebase" button in the top right.
- Merge conflicts can be solved using the procedure at mw:Technical contributor onboarding/Resolve merge conflict.