Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git mergetool with Meld on Windows

Tags:

git

meld

In Linux, my favorite merge tool is Meld, and I've had no problems using or configuring it to work with Git. However, in Windows it has been a different story.

First, I installed Meld from a bundle I found here: https://code.google.com/p/meld-installer/

Then, I configured my .gitconfig like so to support Meld as the default mergetool

[merge]                                                           tool = meld                                                                           [mergetool "meld"]                                                path = C:\\Program Files (x86)\\Meld\\meld\\meld.exe     keepBackup = false                                        trustExitCode = false 

So, when I have a conflict, I do git difftool and Meld does in fact open. However, the paths to the files that Git writes to pass to the diff tool is incorrect. For example, even though Git generates the BASE, LOCAL, and REMOTE files in the repository directory (the location I called git mergetool from), Meld tries to open each of those files in the directory of the executable.

Instead of opening C:\repo\roses.txt.LOCAL.2760.txt, Meld tries to open C:\Program Files (x86)\Meld\meld\roses.txt.LOCAL.2760.txt.

Has anyone ran into this before or know how to configure Git / Meld to work correctly in Windows?

like image 590
Nelson Avatar asked Feb 11 '13 21:02

Nelson


People also ask

Does Meld work on Windows?

Getting it. Meld is packaged for most Linux/Unix distributions, including Fedora, Ubuntu, and Suse. Unless you want the absolutely latest version, you should install Meld through your package manager. Windows users should download the MSI, or for older releases, check out the Meld installer project.

How do I use Mergetool Meld in git?

git mergetool allows you to use a GUI merge program (i.e. Meld) to resolve the merge conflicts that have occurred during a merge. Like difftool you can set the GUI program on the command line using -t <tool> / --tool=<tool> but, as before, it makes more sense to configure it in your . gitconfig file.

What is Mergetool in git?

DESCRIPTION. Use git mergetool to run one of several merge utilities to resolve merge conflicts. It is typically run after git merge. If one or more <file> parameters are given, the merge tool program will be run to resolve differences on each file (skipping those without conflicts).


1 Answers

Why do you not use git bash for Windows?

After install meld simply:

git config --global merge.tool meld git config --global mergetool.meld.path "C:\Program Files (x86)\Meld\Meld.exe" <- path to meld here 

Thats all!

like image 101
Arugin Avatar answered Sep 21 '22 16:09

Arugin