gpt4 book ai didi

xcode - 带有 opendiff 的 git diff 给出 "Couldn' t launch FileMerge"error

转载 作者:IT王子 更新时间:2023-10-29 00:40:03 27 4
gpt4 key购买 nike

我已将 git 配置为使用 ~/bin/opendiff-git.sh 作为我的外部差异工具。该脚本如下所示:

opendiff $2 $5

当我尝试从命令行执行 git diff 时,我收到此消息:

2011-02-18 13:58:55.532 opendiff[27959:60f] exception raised trying to run FileMerge: launch path not accessible
2011-02-18 13:58:55.535 opendiff[27959:60f] Couldn't launch FileMerge
external diff died, stopping at source/some_file.m.

这是怎么回事?这已经工作了好几个月,但最近停止工作了。

最佳答案

因此,在我删除 beta 开发人员文件夹以尝试解决此问题(无法使用 merge 工具进行修复)之后,我在命令行中偶然发现了这一点:

Error: No developer directory found at /Developer Beta. Run /usr/bin/xcode-select to update the developer directory path.

原来你可以设置你需要它使用的开发者路径:

Usage: xcode-select -print-path
or: xcode-select -switch <xcode_folder_path>
or: xcode-select -version
Arguments:
-print-path Prints the path of the current Xcode folder
-switch <xcode_folder_path> Sets the path for the current Xcode folder
-version

看起来安装测试版已自动将该路径设置为测试版。要修复它,请运行此命令:

sudo /usr/bin/xcode-select -switch /Developer

这对我来说已经解决了。

更新

Ying 在下面的评论非常重要,足以包含在答案中。从 Xcode 4.3 开始,该文件夹的位置已更改为在应用程序包内:

sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer/

关于xcode - 带有 opendiff 的 git diff 给出 "Couldn' t launch FileMerge"error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5037230/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com