如何在 Windows 上使用 Meld 作为与 Sourcetree 的合并工具? [英] How do I use Meld as a merge tool with Sourcetree on Windows?
问题描述
我的 .gitconfig
文件中有以下内容:
I have the following in my .gitconfig
file:
[user]
name = myname
email = myname@gmail.com
[core]
autocrlf = true
excludesfile = C:\Users\myname\Documents\gitignore_global.txt
[diff]
tool = meld
[difftool "meld"]
cmd = "C:/Program Files (x86)/Meld/meld/meld.exe"
prompt = false
[merge]
tool = meld
[mergetool "meld"]
cmd = "C:/Program Files (x86)/Meld/meld/meld.exe"
[difftool "sourcetree"]
cmd = "C:/Program Files (x86)/Meld/meld/meld.exe $PWD/$LOCAL $PWD/$BASE $PWD/$REMOTE"
[mergetool "sourcetree"]
cmd = 'C:/Program Files (x86)/Meld/meld/meld.exe' "$LOCAL" "$REMOTE" "$MERGED"
trustExitCode = true
在 Sourcetree 中,我有以下设置:
And in Sourcetree, I have the following settings:
然而,当我在 Sourcetree 上右键单击一个文件进行外部差异时,我能够打开 Meld,但根本没有显示文件的内容.
However, when I right-clicked a file on Sourcetree to do an external diff, I was able to open Meld, but the contents of the file were not displayed at all.
我在设置中做错了什么?
What have I done wrong in the settings?
推荐答案
我觉得现有的答案有点没有抓住重点.这是我自己的狗粮:
I feel the existing answers slightly missed the point. Here is my own dog food:
参数详细信息:
Diff: $LOCAL $REMOTE
Merge: $LOCAL $BASE $REMOTE --auto-merge --output=$MERGED
对于 External Diff
,您需要从参数列表中删除 $BASE.
For External Diff
, you need to remove $BASE from your argument list.
对于三路合并,您需要改为点击External Merge Tool
选项,该选项仅在存在任何未解决的冲突时可用.
For 3-way merging, you need to click on the External Merge Tool
option instead, which will only be available if there are any unsolved conflicts.
如果您不限于Sourcetree + Meld,我认为Git 扩展 + KDiff3 套件也可能是一个很好的开源替代方案.
If you are not restricted to Sourcetree + Meld, I reckon the Git Extensions + KDiff3 suite could be a good open-sourced alternative also.
这篇关于如何在 Windows 上使用 Meld 作为与 Sourcetree 的合并工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!