How to change VS Code's merge conflict layout?

I use VS CODE for version control (using git).

Every time I had a conflict, VS CODE showed me with a layout where I could see all the changes in one window:

with a layout where I could see all the changes in one window

However, with no advice, it change to a weird 3 windowed design where I can't understand anything.

Does someone know how can I go back to the first design?

13326 次浏览

这个特性(3路合并编辑器)可以通过将 git.mergeEditor设置为 true来启用,并将在以后的版本中默认启用。

您可以将其设置回 false,以便根据需要返回到以前的设计。

  1. 转到 VS 代码设置

screenshot of context menu to get to settings

  1. 取消 Git: 合并编辑器设置

screenshot of setting

现在您应该能够看到以前的合并布局。

这个新的3-way 合并编辑器似乎有一个可怕的用户体验问题。对我来说,简单地切换到合并编辑器的‘ false’并不能像下面这样工作:

git.mergeEditor = false

在这个编辑器完全停止向我显示任何合并冲突行之后。 我最后必须这样做,以恢复到原来的合并冲突视图。

  "diffEditor.codeLens": true,
"git.mergeEditor": false
  1. Hit ctrl+shift+p to open command pallet and open the settings json by typing Preferences: Open User Settings (JSON) (or start typing 'settings' and this will come up)

  2. 在主 JSON 对象中添加 "git.mergeEditor": false(如果需要,预先插入逗号)

  3. ctrl + shift + p键入 Developer: Reload Window重新加载视窗。

  4. 合并编辑器的旧类型应该回来了。.但是您可能需要等待一分钟才能获得完整的 UI (在我的机器上,accept incoming按钮等没有返回一点)。