Visual Studio Code how to resolve merge conflicts with git?

annedroiid picture annedroiid · Jul 6, 2016 · Viewed 194.9k times · Source

I tried to merge my branch with another branch and there was a merge conflict. In Visual Studio Code (version 1.2.1) I resolved all of the issues, however when I try to commit it keeps giving me this message:

You should first resolve the un-merged changes before committing your changes.

I've tried googling it but I can't find out why it won't let me commit my changes, all of the conflicts have disappeared.

Answer

Sajeetharan picture Sajeetharan · Jun 21, 2017

With VSCode you can find the merge conflicts easily with the following UI. enter image description here

(if you do not have the topbar, set "editor.codeLens": true in User Preferences)

It indicates the current change that you have and incoming change from the server. This makes it easy to resolve the conflicts - just press the buttons above <<<< HEAD.

If you have multiple changes and want to apply all of them at once - open command palette (View -> Command Palette) and start typing merge - multiple options will appear including Merge Conflict: Accept Incoming, etc.