【问题标题】:Cannot find FileMerge (opendiff tool) but I have xcode 4.6 installed找不到 FileMerge(opendiff 工具),但我安装了 xcode 4.6
【发布时间】:2014-01-14 14:44:26
【问题描述】:

当我尝试将 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
$

我已于 2013 年 4 月安装了 XCode 4.6.3 和 Xcode 命令行工具。我正在运行 OSX 10.7.5

我尝试了以下两个链接的解决方案,但没有成功:

git diff with opendiff gives "Couldn't launch FileMerge" error

Is filemerge still available after Xcode 4.3 installation?

当我转到Xcode -> Open Developer Tool 时,我在选项列表中看不到FileMerge。有一个More Developer Tools 链接将我带到这里:https://developer.apple.com/downloads/index.action?name=for%20Xcode%20-

如何让 FileMerge 正常工作?

【问题讨论】:

  • 我认为 FileMerge 应该是默认安装的。你没有/Applications/Xcode.app/Contents/Applications/FileMerge.app吗?
  • ls /Applications/Xcode.app/Contents/ 不显示Applications 文件夹
  • 嗯,我有 Xcode 5。我认为这些工具可能在 4 中的不同目录中。尝试在整个 Xcode.app 包中搜索(使用find)。

标签: xcode macos git filemerge


【解决方案1】:

FileMerge 位于 Xcode 中。

从命令行:

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

打开后进入该目录:

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

一切就绪。

【讨论】:

    【解决方案2】:

    奇怪。 “XCode 4.5, where is FileMerge ?”建议:

    与 Xcode 4.5 捆绑的 FileMerge 不能作为独立应用程序运行。我尝试从应用程序包中压缩它。我能够扩展它以在桌面上显示 FileMerge 应用程序。但是当我尝试运行它时,我收到一个错误,说它无法打开。

    Apple 的开发者下载站点包含 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"
    

    【讨论】:

      【解决方案3】:

      如果你安装了xcode,那么你可能可以从命令行运行以下命令直接打开FileMerge

      open /Applications/Xcode.app/Contents/Applications/FileMerge.app/
      

      【讨论】:

        【解决方案4】:

        尝试重新安装 Xcode。我有同样的问题,它为我解决了这个问题!似乎 Merge 实用程序以某种方式损坏了。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2019-04-14
          • 1970-01-01
          • 2019-08-19
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2022-06-29
          相关资源
          最近更新 更多