Git Extensions and Meld merge
Asked Answered
M

4

6

Is it possible to use Meld as a merge tool when using Git Extensions on Windows?

Mozellemozes answered 19/7, 2013 at 9:50 Comment(0)
R
3

In Git Extension: Settings -> Git Config

Merge tool: meld
Path to mergetool: C:/Program Files (x86)/Meld/Meld.exe
Merge tool command: "C:/Program Files (x86)/Meld/Meld.exe" --diff "$BASE" "$LOCAL" "$REMOTE" --output "$MERGED"
Roentgen answered 27/11, 2015 at 10:18 Comment(2)
This answer doesn't save merged files for me, nor is it how git mergetool launches Meld. See my answer below which uses the git way of launching it & saves correctly.Epicardium
I'm not totally clear why, but with the --diff flag, the --output param seems to be ignored. Removing it causes the file to save to $MERGED correctly. (As other comments have suggested, this could be a Meld 3.x vs 2.x issue?)Nothingness
M
1

Yes it is, in response to this issue.

Mozellemozes answered 29/9, 2013 at 19:40 Comment(2)
meld is a default difftool, but not a default mergetool. That ticket is still open as of 2016-05-09Catachresis
@Catachresis you're right. I'll accept Tomasz's answer as it's more useful if you are looking for merge as well as diff.Mozellemozes
E
1

This answer is correct. The other answer won't save the merge result/ changes to your actual workspace file!

In Git Extension: Settings -> Git Config

Mergetool = meld    (just type it in, don't use the combo)
Path to mergetool = </path/to/Meld.exe>
Mergetool command = </path/to/Meld.exe> \"$LOCAL\" \"$BASE\" \"$REMOTE\" --output \"$MERGED\"

I had been struggling to get Meld working with GitExtensions, trying the previous answer & related posts.

This is a revised answer -- I had previously posted the command-line 'git mergetool' uses, but that didn't offer a clean 3-way merge with ancestor; instead the center pane showed conflict markers.

See also my GitHub comment on the GitExtensions feature-request discussing this.

Epicardium answered 24/11, 2016 at 2:40 Comment(1)
This is the right answer for Meld 3.0 and above I think. Meld 2.0 has no problem with the accepted answer but not working for 3.0. Thanks Thomas WSenlac
R
1

Like Thomas, the accepted answer didn't quite work for me. The merged file was not saved after meld was closed. However, Thomas's answer didn't work for me either. While the file did save, it opened in Meld with the merged markup.

Instead, I'm using a command line I've been using with Sourcetree. Here's what worked for me.

Mergetool command = </path/to/Meld.exe> \"$LOCAL\" \"$BASE\" \"$REMOTE\" --output=\"$MERGED\" --auto-merge
Rabush answered 6/12, 2016 at 23:29 Comment(1)
--auto-merge at the end was the missing part for meForwards

© 2022 - 2024 — McMap. All rights reserved.