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

16,136

Solution 1

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

Solution 2

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.

Share:
16,136
Tony_Henrich
Author by

Tony_Henrich

Updated on June 07, 2022

Comments

  • Tony_Henrich
    Tony_Henrich almost 2 years

    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