Home > Software design >  resolve merge conflict in code-editor says 'cannot edit in readonly mode'
resolve merge conflict in code-editor says 'cannot edit in readonly mode'

Time:11-23

i have a merge conflict and want solve it in code IDE.

git merge mod-profile-selector
error: Merging is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
~/g/0/b/d/m/0ad-TTS-speaking-population (main|MERGING) [128]> 

code show me this screen:

enter image description here

CodePudding user response:

You should only be updating the Result file (normally the bottom file).

You're trying to edit files that are not really in your branch.

When you're looking at a three way merge the Incoming and Current files are temporary read-only versions of the file with the conflict. VS Code creates these temp files so that you can see how the file looked before the conflict (in the branches you're merging from and to).

The only file that is really in your branch is the file that has <<<<<<< HEAD, =======, >>>>>>> ... markings. You can see this if you disable the Merge Editor and open the file in VS Code or if you just open the file in a different editor that doesn't have a merged editor embedded (vi, notepad, etc.)

  • Related