vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Git: Use VS Code as merge editor

Open nchammas opened this issue 10 years ago • 116 comments

1.0.0 introduced the ability to use VS Code as a git difftool. The relevant global .gitconfig lines are as follows:

[diff]
    tool = default-difftool
[difftool "default-difftool"]
    cmd = code --wait --diff $LOCAL $REMOTE

How can I use VS Code as a git mergetool?

The relevant arguments it needs to accept, I believe, are $LOCAL, $REMOTE, $BASE, and $MERGED.

nchammas avatar Apr 25 '16 15:04 nchammas

Not supported yet.

joaomoreno avatar Apr 26 '16 07:04 joaomoreno

Is this feature being included in the next iteration, by any chance?

skijit avatar May 04 '16 18:05 skijit

Probably not, this is a big endeavour, since a merge UI needs to be implemented.

joaomoreno avatar May 24 '16 09:05 joaomoreno

Is there any plan for the merge UI to support three-way merging? (e.g. change a, change b, common ancestor)

ZombieProtectionAgency avatar Jun 16 '16 19:06 ZombieProtectionAgency

We wouldn't have it any other way. 😉

joaomoreno avatar Jun 17 '16 06:06 joaomoreno

Can't upvote this one enough. This is the top scenario for me to fall back to a different editor/IDE (*cough* memory-hog Webstorm cough) :)

theoy avatar Aug 08 '16 19:08 theoy

If possible, this would be a godsend, due to several reasons:

  1. Meld, although functional, severely lacks in functionality in relation to configurable key-bindings and colour highlighting, and is really really slow to start on my Windows machine, even when installed on an SSD.
  2. I'd like the merge editor to also accept the same .editorconfig/settings which my main text editor has, and if vscode does fill that gap, it'd be awesome.
  3. On smaller levels, the editor theme and familiarity with the interface is also a plus - sometimes I or my team makes mistakes while merging due to no syntax highlighting, which although small, have caused huge bugs in production systems. And some of those mistakes are rather difficult to even fathom until they occur. I guess there would always be similar problems with mergetools, but perhaps they will be reduced if one could merge in the same environment in which one writes.

Like I said, meld is ok, but it'd be super if vscode would some day be used in that scenario.

kumarharsh avatar Aug 08 '16 19:08 kumarharsh

Visual Studio was always my code merger of choice. Would love to see this feature!

egucciar avatar Oct 28 '16 17:10 egucciar

No problem on using other git mergetool but really would like to see own merge UI happen really soon!!

cchitsiang avatar Oct 29 '16 03:10 cchitsiang

😐 meh.

I expect these features in heavy weight IDEs. In vscode's class of light weight editors (in which I'd consider atom, sublime, etc) I don't. For git-related activities I favor a terminal and vim for conflict resolution. The GUI crowd already has great uni-taskers like meld, diffmerge, kaleidoscope, etc.

@kumarharsh that's a good point about immediate feedback (e.g.; linting.) Going the vim route above, I suppose you can set git's default external editor to vscode... tho could be a pain to provide context to the project-specific linting/syntax/etc rules.

eckdanny avatar Dec 02 '16 08:12 eckdanny

+1

herbertpimentel avatar Dec 06 '16 18:12 herbertpimentel

can this feature be implemented as an extension of vscode? or any exists ext recommended.

ghost avatar Dec 07 '16 13:12 ghost

I dont think so, as i can see extesions are not allowed to create ui features

Enviado do meu telefone Windows 10

De: Tank Sui Enviado:quarta-feira, 7 de dezembro de 2016 10:41 Para: Microsoft/vscode Cc:Herbert Pimentel; Comment Assunto: Re: [Microsoft/vscode] Using VS Code as a git mergetool (#5770)

can this feature be implemented as an extension of vscode? or any exists ext recommended. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

herbertpimentel avatar Dec 07 '16 14:12 herbertpimentel

The plugin can provide UI features: look at Git History. It renders a webview, which can "potentially" be used as a merge-tool. But I think it'll be very hard for a plugin to do it without some level of support by vscode itself.

kumarharsh avatar Dec 07 '16 14:12 kumarharsh

Main issue with kaleidoscope, meld, etc tools is in very typical use-case: Edit result during merge. Like, you know: accept this line from the left, accept that line from the right, and also, add this small fix so they both can work together.
Captain obvious is reporting: Merge tools are good in merging :D But editing using i.e meld is totally pain especially when you are get used to such handy tool as vscode. That's why most developers want merge-tool integrated in their editor.

josser avatar Dec 07 '16 16:12 josser

P4merge's 4-pane 3-way merge UI is excellent. http://naleid.com/blog/2013/10/29/how-to-use-p4merge-as-a-3-way-merge-tool-with-git-and-tower-dot-app

jayshah123 avatar Dec 30 '16 15:12 jayshah123

allowing us to see the diff (incredibly useful features in an editor) but not giving us a way to merge is very underwhelming

idibidiart avatar Feb 01 '17 21:02 idibidiart

A VS Code extension would be perfect for merging conflicts.

MarvDann avatar Feb 27 '17 10:02 MarvDann

+1

bogminic avatar Mar 02 '17 19:03 bogminic

Git side by side conflict resolver not working in latest VS code.

Version 1.10.2 Commit 8076a19fdcab7e1fc1707952d652f0bb6c6db331 Date 2017-03-08T14:02:52.799Z Shell 1.4.6 Renderer 53.0.2785.143 Node 6.5.0

vidhya03 avatar Mar 14 '17 08:03 vidhya03