126

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?

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
  • 1
    See https://code.visualstudio.com/updates/v1_69#_3-way-merge-editor – Gino Mempin Aug 08 '22 at 12:17
  • that is a common layout of ABC merge editors, your image is a view of the raw conflict file with a code lens above the conflict – rioV8 Aug 08 '22 at 16:27
  • 6
    @rioV8 Three panes is nice and all, but their implementation of that concept is a disaster because it loses a lot of flexibility from the prior design. Now you need to manually copy and paste all over the place to actually combine code from both changes. Also the vertical layout makes it hard to figure out where you are - the merged pane should be in the middle, not the bottom. Intellij has a much better approach that keeps the best of both worlds in terms of flexibility and intelligibility. – Drew Nutter Aug 16 '22 at 18:54
  • @DrewNutter you can check both sections in a particular order to get both parts in the merge panel, they should update the doc about the merge editor – rioV8 Aug 16 '22 at 19:03
  • @rioV8 For me, checking one box unchecks the other box. And sometimes I only get a checkbox on one side even though there are highlighted text boxes on either side. – Drew Nutter Aug 16 '22 at 19:20
  • @DrewNutter I haven't tried but the update notes show it should work, https://code.visualstudio.com/updates/v1_69#_workbench – rioV8 Aug 16 '22 at 19:29
  • classic Microsoft forcing you to use their new feature and removing what you're used to using. – Trevor Bye Aug 29 '22 at 21:07
  • I have answered this question in this [link](https://stackoverflow.com/a/73403806/11764384) – Virinchi Manepalli Aug 30 '22 at 12:23
  • You should except an answer if one of them worked for you please. – 13garth Sep 05 '22 at 13:14
  • @DrewNutter Intelljs 3 way merge layout is terrible and almost unusable in my opinion takes up way too much screen real estate and doesnt let me navigate to other files while I merge, vs codes inline is far superior and intellj should implement a similar option. Can't seem to get the inline to work properly after the update now though, its inconsisten opens some files as inline and some as 3 way, anyone know how to open all as inline? – nightwolf555 May 23 '23 at 22:07

5 Answers5

100
  1. Go to VS Code settings

screenshot of context menu to get to settings

  1. Untick the Git: Merge Editor setting

screenshot of setting

Now you should be able to see the previous merge layout.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
Sashini Hettiarachchi
  • 1,630
  • 2
  • 10
  • 21
19

This feature (3 way merge editor) can be enabled by setting git.mergeEditor to true and will be enabled by default in future releases.

You can set it back to false to go back to the previous design as you want.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
Dylan Tavares
  • 331
  • 1
  • 6
10

This new 3-way merge editor seems to have a terrible UX issue. For me simply switching to merge editor to 'false' doesn't work as below:

git.mergeEditor = false

After this editor completely stopped showing me any merge conflict line. I have to finally do like this to revert back to original merge conflict view.

  "diffEditor.codeLens": true,
  "git.mergeEditor": false
Sharad
  • 838
  • 1
  • 7
  • 15
0
  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. In the main JSON object add "git.mergeEditor": false (insert comma beforehand if needed)

  3. Hit ctrl+shift+p and type Developer: Reload Window to reload the windo.

  4. The old type of merge editor should be back.. but you may need to wait a minute to get the full UI back (on my machine, the accept incoming buttons etc. didn't come back for a little).

DonCarleone
  • 544
  • 11
  • 20
0

Update 2023 in case the conflict UI has crashed/not displayed

When you rebase a file with embedded conflicts within conflicts VScode's in- file-conflict-display(blue/green UI) might glitch due to too-many git markers present, rendering merge impossible without CLI.

Apply workaround by enabling and switching to 3 way conflicts window.

  • enable merge editor (by searching the settings or modifying vscode config file locally)

  • use vscode's merge display by going to Source Control tab then clic the file with ! exclamation mark before the name of the file

  • solve the maximum number of conflict using the new 3 windows conflict UI (remember current and incoming are inverted in case of rebasing)

  • go back to normal file UI and the classic in-file-conflict-UI (green/blue) should be back online

  • finally git add . && git rebase --continue && :wq (vim) in case of rebase to pass to the next commit to handle.

Rule of Thumb: Remember to always create a temporary local branch of your feature before merging/rebasing your feature branch before PR. This will be used as backup to keep the design intent in mind. Then always run code(and lint) to check for obvious typos/merge artifacts (ie these git flags or unclosed loops/functions).

Alsushi
  • 373
  • 3
  • 14