问题描述
我的.gitconfig
文件中包含以下内容:
I have the following in my .gitconfig
file:
[user]
name = myname
email = [email protected]
[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的合并工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!