3

I am trying to use command git difftool -d for a folder diff.

The command get diff list successfully (show in FileMerge.app). But when I try to open each diff file. I get file does not exist error.

Output log:

$ git difftool -d 
merge tool candidates: opendiff kdiff3 tkdiff xxdiff meld kompare gvimdiff diffuse ecmerge p4merge araxis bc3 codecompare emerge vimdiff

Image:

 ng image

I am using git version 1.8.1.1 on mac OS X 10.9. Thanks.

4

2 回答 2

3

问题是 opendiff 命令返回导致 difftool 删除临时目录和您正在比较的所有文件。经过大量搜索后,我发现了这一点,基本上你必须保持 opendiff 运行,直到 FileMerge 退出。将您的 git 配置更改为:

[diff]
    tool = opendiff
[difftool]
    prompt = false
[difftool "opendiff"]
    cmd = /usr/bin/opendiff \"$LOCAL\" \"$REMOTE\" -merge \"$MERGED\" | cat

在这里找到了答案: https ://gist.github.com/bkeating/329690

于 2015-03-23T22:07:23.683 回答
1

通过输出到 less 或使用 sleep 来防止 opendiff 退出

例如,将以下行添加到 .gitconfig

[difftool "opendiff"]
        cmd = /usr/bin/opendiff \"$LOCAL\" \"$REMOTE\" -merge \"$MERGED\" | less
于 2017-11-08T12:43:26.390 回答