How to resolve branch conflicts in VSCode GitHub Pull Requests and Issues extension?

Viewed 16032

I can't figure out how to resolve the conflict in this pull request so that I can merge it. How can I fix the problem using the VSCode GitHub Pull Requests and Issues GUI?

There are only three lines that have changed, all within one file, for this pull request. The pull request description and diff are shown in the first two images below, respectively. Nothing there seems to be in conflict. However, when I look at the code for the master branch that I am trying to merge into, shown in the third image, line 17 is different. I think that is the conflict. Why doesn't that conflict show up in the diff? How can I keep line 17 from the master branch, add line 17 from the pull request below it, merge back to the master branch, and close the pull request? I haven't found a way to view the pull request code side by side with the master code and I'm not sure which I need to push updates to.

Pull Request Description

Pull Request Diff

Master Branch

I am trying to merge the pink branch in the graphic below.

enter image description here

2 Answers

You should be in the branch you are currently modifying (not master) and first merge master into this branch: under source control, click the three dots and select in the menu Branch -> Merge Branch (see screenshot) and select Master. It will say you now have conflicts that you need to resolve manually, and then you should be clear to go.

screenshot

First of all, you must click "Exit Review Mode" to become back the regular code! After them, you must approve the changes (with or without a comment) and then, you must go to GitHub and click there "Merge pull request" (with or without a comment) and the Pull Request would merge back to the branch, where you started/created the Pull Request.

Github Pull Requests Extension for Visual Studio Code

Related