Git mergetool with Meld on Windows

前端 未结 9 990
名媛妹妹
名媛妹妹 2020-12-02 05:19

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.

Fir

相关标签:
9条回答
  • 2020-12-02 05:54

    Schuess, be careful for space character in directories!

    [merge]
        tool = meld
    [mergetool "meld"]
        prompt = false
        keepBackup = false
        keepTemporaries = false
        path = C:/Program Files (x86)/Meld/Meld.exe
        cmd = \"/C/Program Files (x86)/Meld/Meld.exe\" \"$PWD/$LOCAL\" \"$PWD/$BASE\" \"$PWD/$REMOTE\" \"--output=$PWD/$MERGED\"
    
    0 讨论(0)
  • 2020-12-02 05:57

    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!

    0 讨论(0)
  • 2020-12-02 06:02

    I had the exact same problem and found I had to brute force my way to get it to work. Here is what I put in my .gitconfig file. (Note my meld executable is in a different location)

    [merge]
        tool = meld
    [mergetool "meld"]
            cmd = "/c/Meld/meld/meld.exe $PWD/$LOCAL $PWD/$BASE $PWD/$REMOTE --output=$PWD/$MERGED"
    
    0 讨论(0)
  • 2020-12-02 06:05

    For some reason, in Windows 10 the PATH environmental variable could not be set properly during the installation, so a strange exception is raised saying that it is not able to find some .dll that are under "C:\Program Files (x86)/Meld/bin" directory.

    A workaround for me was, execute in git bash:

    export PATH=$PATH:"/C/Program Files (x86)/Meld/lib" 
    

    Or add to windows PATH

    C:\Program Files (x86)/Meld/bin
    
    0 讨论(0)
  • 2020-12-02 06:06

    None of the answers worked for me. I ended up with this in the .gitconfig-file:

    [merge]
      tool = meld
    [mergetool "meld"]
      cmd = 'C:/Program Files (x86)/Meld/Meld.exe' $LOCAL $BASE $REMOTE --output=$MERGED
    [mergetool]
      prompt = false
    

    After a git merge mybranch ending with conflicts, you simply type git mergetool and meld opens. After a save, you have to commit in git and the conflicts are resolved.

    For some reason, this only worked with Meld 3.18.x, Meld 3.20.x gives me an error.

    0 讨论(0)
  • 2020-12-02 06:10

    I too faced similar issue.Operating system used is Windows 10 and the following changes worked for me.It seems more like path issue

    git config --global mergetool.meld.path "/c/Program Files (x86)/Meld/Meld.exe" <- path to meld here
    
    0 讨论(0)
提交回复
热议问题