Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manually resolve a merge conflict in a sqlproj file in Visual Studio/VSTS/Git?

I am not very familiar with Git in Visual Studio 2017. I created a new branch from a branch. Made some changes. Pushed the new changes to our repo at visualstudio.com. Created a new pull request and now I am getting the error below. I am not sure what the next step is. If I click on Abandon, I get two options. Reactive or delete source branch. How do I manually resolve this issue? I am trying to find a way to show the conflict inside Visual Studio so I can use the merge tool and edit the conflict. I have no changes showing in VS after I have pushed them to the remote repo. Can't find a way to find out what the cause of the conflict is and how to manually resolve it.

This link shows how to resolve Git conflicts but I have nothing in VS showing any conflicts. The conflict warning is showing on the VSTS website. What's the next step?

enter image description here

like image 926
Tony_Henrich Avatar asked Nov 20 '17 05:11

Tony_Henrich


People also ask

How do you resolve conflicts in VS code new?

Alt+Space. Also in VS Code 1.70, the three-way merge editor, for quickly resolving Git merge conflicts, is enabled by default. The merge editor features improved context menus, new commands to accept all changes from one side, enhanced diff colors, and a greater emphasis on conflicting versus non-conflicting changes.


2 Answers

Refer to these steps to resolve conflicts:

  1. Open Branches in Team Explorer
  2. Double click the target branch to switch branch (e.g. master)
  3. Right click the target branch=> Pull
  4. Double click the source branch to switch branch (e.g. dev)
  5. Click Merge
  6. Choose master in Merge from branch and choose dev in Into current branch
  7. Click Merge
  8. Click Conflicts link=>Select the file=>Click Merge
  9. Resolve conflicts
  10. Click Commit Merge in Team Explorer
  11. Commit and push dev changes to remote branch
  12. Complete the pull request
like image 99
starian chen-MSFT Avatar answered Oct 24 '22 18:10

starian chen-MSFT


In order to see a difference between two branches locally (and being able to resolve a conflict locally), try and fetch first: that will fetch all branches, and update their history.

See "Update code with fetch and pull".

Then you can try a local merge to see and resolve the conflicts: see "Resolve merge conflicts". If you can, rebase your branch on top of the updated target branch locally, then force push (if you are the only one working on said branch): that will update the pull request.
If not, merge the target branch to your branch and resolve the conflicts locally. Then a simple push of the merge commit will be enough.

like image 24
VonC Avatar answered Oct 24 '22 18:10

VonC