嗨,我尝试将opendiff用作git mergetool,但是当我运行mergetool时,出现以下错误消息:



我究竟做错了什么?之前它工作正常,但是由于我安装了新的硬盘,所以不再工作了:(

最佳答案

您需要将opendiff配置为全局merge.tool:

# locate xcode utilities
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

# set "opendiff" as the default mergetool globally
git config --global merge.tool opendiff

如果收到Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo,则打开XCode并接受许可证即可解决此问题。

09-04 18:03