`git difftool -d` get 'file does not exist' error on mac

纵饮孤独 提交于 2019-12-06 02:42:00

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

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!