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.

Jakub Jirutka
  • 10,269
  • 4
  • 42
  • 35
jeecd
  • 61
  • 3

2 Answers2

3

The problem is the opendiff command returns which causes difftool to delete the temp directory and all the files you are comparing. After a ton of searching I found this, basically you have to keep that opendiff running until FileMerge exits. change your git config to:

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

found the answer here: https://gist.github.com/bkeating/329690

Will Carle
  • 31
  • 3
  • 1
    The proposed configuration does not solve the problem in my environment (as *opendiff* still returns almost immediately). I opened [a question](http://stackoverflow.com/q/33955712/1027706) where I tried to detail the steps taken and the results. – Ad N Nov 27 '15 at 11:08
1

Prevent opendiff from exiting by outputting to less or using sleep

E.g put following line to .gitconfig

[difftool "opendiff"]
        cmd = /usr/bin/opendiff \"$LOCAL\" \"$REMOTE\" -merge \"$MERGED\" | less
Erkki Nokso-Koivisto
  • 1,203
  • 15
  • 19