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?
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,
<conflicts resolved files>
merge conflict resolved message
" In VSCode when you have conflicts in multiple files, they're shown in the git panel and you can open files one by one and resolve them.
When you resolve the conflicts in a file, you should save the file then click the +
button of that file (shown in the image bellow).
This will result in staging the file. If you click this button and there's unresolved conflicts in that file, you'll get this message:
Are you sure you want to stage with merge conflicts?
Now if you resolve conflicts of all files and click on the +
button that is above all files (to stage all files with conflict) (Shown in the image bellow), it'll still give you the same message (Although you've already resolved all conflicts).
So I recommend that you click the +
of each file individually so that you'll be sure that you resolved all conflicts before staging the file.
I believe this bug is fixed in recent versions of VSCode.
In my case, I realized I had Auto Save turned off. I know, it's too silly. But worth checking.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With