在Windows上与Meld合并工具 [英] Git mergetool with Meld on Windows

查看:443
本文介绍了在Windows上与Meld合并工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Linux中,我最喜欢的合并工具是Meld,并且在使用或配置它以使用Git方面没有任何问题。然而,在Windows中,它已经不同了。



首先,我从我在这里找到的一个包中安装了Meld: https://code.google.com/p/meld-installer/



然后,我配置我的.gitconfig就像这样支持Meld作为默认的合并工具


$ b $ pre $ [合并]
工具= meld

[mergetoolmeld]
path = C:\\ Program Files(x86)\\\\\\\\\\\\\\\\\\\\\\ b $ b keepBackup = false
trustExitCode = false

所以,当我发生冲突时,我做混合difftool和Meld事实上打开。但是,Git写入传递给diff工具的文件的路径不正确。例如,即使Git在存储库目录(我称之为git mergetool的位置)中生成BASE,LOCAL和REMOTE文件,Meld也会尝试打开可执行文件目录中的每个文件。

Meld试图打开C:\程序文件(x86)\而不是打开C:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Meld \ meld \roses.txt.LOCAL.2760.txt。

有没有人遇到过这种情况,或者知道如何配置Git / Meld在Windows中正常工作?

解决方案

为什么你不使用git bash for Windows?

简单地安装之后:

  git config --global merge.tool meld 
git config --global mergetool。 meld.pathC:\程序文件(x86)\Meld\Meld.exe< - 此处为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?

解决方案

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!

这篇关于在Windows上与Meld合并工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆