我正在尝试让Git与DiffMerge协同工作,但在这周之前,我从未使用过这两个工具。无论如何,这一切都是为了Ruby on Rails。
我几乎完全按照http://jdonley83.com/blog/setting-up-git-in-windows-with-diffmerge/的说明去做。然而,当我输入"Git Diff",而不是加载DiffMerge时,命令行就崩溃了。
所以你不需要在网站上重新阅读说明,网站上基本上是说设置两个文件diffmerge-diff.sh和diffmerge-diff.sh,编写如下:
diffmerge-diff.sh
#!/bin/sh
path="$1"
old="$2"
new="$5"
"C:/Program Files (x86)/SourceGear/DiffMerge/DiffMerge.exe" "$old" "$new" --title1="Old" --title2="New $path"和diffmerge-merge.sh:
#!/bin/sh
localPath="$2"
basePath="$1"
remotePath="$3"
resultPath="$4"
if [ ! -f $basePath ]
then
basePath="c:/Users/Joseph/diffmerge-empty"
fi
"C:/Program Files (x86)/SourceGear/DiffMerge/DiffMerge.exe" --merge --result="$resultPath" "$localPath" "$basePath" "$remotePath" --title1="Mine" --title2="Merged: $4" --title3="Theirs"And...meanwhile...my .gitconfig包括以下内容:
[merge]
tool = diffmerge
[mergetool "diffmerge"]
cmd = "c:/Users/Me/GitConfigFiles/diffmerge-merge.sh" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
trustExitCode = false
keepBackup = false
[diff]
tool = diffmerge
external = c:/Users/Me/GitConfigFiles/diffmerge-diff.sh该网站还表示:“您可能需要修改这两个文件中的路径,这取决于您在系统上安装DiffMerge的位置。”但我不知道它们是什么意思。
我知道这可能会有很多信息需要消化,但有人知道问题出在哪里吗?如果无法解决,有没有更简单的方法呢?也许Diffmerge对于入门级Git来说太复杂了?
谢谢您一直鼓励我。
发布于 2013-01-25 12:01:43
“命令行崩溃”是什么意思?我从来没有见过命令行崩溃。
使用git时,您不需要任何difftool。git diff完全没问题。你需要一个很好的工具来进行三向合并,但这是另一个话题。
https://stackoverflow.com/questions/14514876
复制相似问题