无法找到FileMerge(opendiff工具),但我已安装xcode 4.6

6
当我尝试将FileMerge作为Opendiff的GUI运行时,会出现错误:
$ git mergetool -t opendiff
Merging:
Gemfile
Gemfile.lock
...

Normal merge conflict for 'Gemfile':
  {local}: modified file
  {remote}: modified file
Hit return to start merge resolution tool (opendiff): 
2013-12-26 20:00:20.248 opendiff[22367:e07] Couldn't find FileMerge
Gemfile seems unchanged.
Was the merge successful? [y/n] ^C
$

我已经安装了XCode 4.6.3和Command Line Tools for Xcode April 2013。操作系统为OSX 10.7.5。
我尝试过以下两个链接提供的解决方案,但都没有成功: git diff with opendiff gives "Couldn't launch FileMerge" error Is filemerge still available after Xcode 4.3 installation? 当我进入“Xcode->打开开发工具”时,在选项列表中我没有看到“FileMerge”,而是有一个“更多开发工具”的链接,它将我带到这里: https://developer.apple.com/downloads/index.action?name=for%20Xcode%20- 如何让FileMerge工作?

1
我认为FileMerge应该是默认安装的。你没有/Applications/Xcode.app/Contents/Applications/FileMerge.app吗? - LaC
ls /Applications/Xcode.app/Contents/ 不会显示一个 Applications 文件夹。 - Eric Baldwin
嗯,我有Xcode 5。我觉得工具可能在4版本中的不同目录下。尝试在整个Xcode.app包内搜索(使用find命令)。 - LaC
4个回答

22

FileMerge在Xcode内部。

从命令行:

cd /Applications/Xcode.app/Contents/Applications/
open .

打开目录后进入该目录:

  1. 右键单击应用程序
  2. 选择“制作别名”
  3. 将该别名移动到您的应用程序目录中

设置完成了。


6
奇怪。"XCode 4.5,FileMerge在哪里?"建议:
与Xcode 4.5捆绑的FileMerge不能作为独立应用程序运行。我尝试从应用程序包中压缩它。我可以展开它,以显示桌面上的FileMerge应用程序。但是当我尝试运行它时,我收到一个错误,说它无法打开。
苹果公司的开发人员下载网站拥有每个版本的Xcode。您可以尝试将当前版本的Xcode 4.5清除,从开发人员下载网站下载Xcode 4.5,并查看FileMerge是否存在。如果没有,您可以下载Xcode 4.4并查看是否具有FileMerge。
确实,我下载了全新的XCode 4.5安装程序,并将我的更新的4.4升级到了4.5版本,将其移到回收站中,现在我又有了所有的开发工具,包括FileMerge。奇怪...
同一线程的另一个选项:
为什么不只安装命令行工具呢?这将为您提供“opendiff”工具。然后,您可以创建一个类似于此的小脚本,使其有用并实际进行合并。
#!/bin/sh

# Get a hold of the last parameter.
eval LAST=\${$#}

# Now run opendiff with the previous version and the current version.
opendiff ${*} -merge "$LAST"

1
如果您已经安装了Xcode,那么您可以在命令行中运行以下命令来直接打开FileMerge。
open /Applications/Xcode.app/Contents/Applications/FileMerge.app/

0

尝试重新安装Xcode。我遇到了同样的问题,重新安装后问题得到了解决!看起来合并工具出现了某些损坏。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接