Resolved git merge conflict in VS Code, but still says unresolved

midnightnoir picture midnightnoir · Sep 29, 2017 · Viewed 15.2k times · Source

So I have a develop branch and topic branch. I'm using the default Terminal in Window's VS Code. While in the topic branch, I did git merge develop since I just got latest on develop branch. Now there's a simple merge conflict in one file. In VS Code, I resolved the conflict. On the code page, there's no more conflicts that you can Accept Incoming or Accept Current, but when I try to stage the file on the Source Control panel on the left, it shows a warning popup saying Are you sure you want to stage with merge conflicts?

Is this normal? it seems like VS Code doesn't think I resolved the conflict even tho I just did, and there's no more conflict in the file. Or is there something I'm missing Git/VS Code-wise?

Answer

saravana va picture saravana va · Oct 22, 2019

It is an normal behavior. Usually we will get the merge conflicts when we have changes changes in same line of source and destination files of merging.

In your case, you have resolved your conflicts in your file(i mean vs code) but it is not updated to git. So after adding Accept Incoming or Accept Current you have to do below steps,

  1. git add <conflicts resolved files>
  2. git commit -m "merge conflict resolved message"
  3. git push