Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Meld as git mergetool

Tags:

git-merge

meld

I've set:

git config --global merge.tool meld git config --global mergetool.meld.path c:/Progra~2/meld/bin/ 

On "git mergetool" it writes:

Hit return to start merge resolution tool (meld): The merge tool meld is not available as 'c:/Progra~2/meld/bin/' 

I have tried also:

  • /c/Progra~2/meld/bin/
  • "/c/Program files (x86)/meld/bin/"
  • "c:/Program files (x86)/meld/bin/"

result is the same.

when I go to C:/Program files (x86)/meld/bin/ and run

python meld 

the tool runs.

like image 367
Paul Avatar asked Oct 18 '12 14:10

Paul


People also ask

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.


2 Answers

You could use complete unix paths like:

PATH=$PATH:/c/python26 git config --global merge.tool meld git config --global mergetool.meld.path /c/Program files (x86)/meld/bin/meld 

This is what is described in "How to get meld working with git on Windows"

Or you can adopt the wrapper approach described in "Use Meld with Git on Windows"

# set up Meld as the default gui diff tool $ git config --global  diff.guitool meld  # set the path to Meld $ git config --global mergetool.meld.path C:/meld-1.6.0/Bin/meld.sh 

With a script meld.sh:

#!/bin/env bash C:/Python27/pythonw.exe C:/meld-1.6.0/bin/meld $@ 

abergmeier mentions in the comments:

I had to do:

git config --global merge.tool meld git config --global mergetool.meld.path /c/Program files (x86)/Meld/meld/meldc.exe 

Note that meldc.exe was especially created to be invoked on Windows via console. Thus meld.exe will not work properly.


CenterOrbit mentions in the comments for Mac OS to install homebrew, and then:

brew cask install meld git config --global merge.tool meld git config --global  diff.guitool meld 
like image 99
VonC Avatar answered Nov 03 '22 20:11

VonC


This worked for me on Windows 8.1 and Windows 10.

git config --global mergetool.meld.path "/c/Program Files (x86)/meld/meld.exe" 
like image 30
oldwizard Avatar answered Nov 03 '22 20:11

oldwizard