Git Diff and Meld on Windows

后端 未结 5 1234
闹比i
闹比i 2020-12-13 21:03

Has anyone ever made Meld work with Git on Windows? I am trying to make it work and I have no success.

I have Meld installed and when I call it from the command lin

5条回答
  •  攒了一身酷
    2020-12-13 21:08

    Usually, you can find an example on Windows similar to this gist, with meld.exe being in your PATH):

    git config --global merge.tool meld
    git config --global mergetool.meld.cmd 'meld.exe \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"'
    
    git config --global diff.tool meld
    git config --global difftool.meld.cmd 'meld.exe \"$LOCAL\" \"$REMOTE\"'
    

    You can find more robust settings in "Git mergetool with Meld on Windows", but the idea remains the same.


    The OP reports in the comments:

    For the difftool, your commands write the following configurations in .gitconfig:

    [diff]
      tool = meld
    [difftool "meld"]
      cmd = meld.exe \\\"$LOCAL\\\" \\\"$REMOTE\\\"
    

    I changed them to:

    [diff]
      tool = meld
    [difftool "meld"]
      cmd = meld.exe $LOCAL $REMOTE
    

    and everything worked fine.

提交回复
热议问题