找不到 FileMerge(opendiff 工具),但我安装了 xcode 4.6

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20793384/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:28:10  来源:igfitidea点击:

Cannot find FileMerge (opendiff tool) but I have xcode 4.6 installed

xcodemacosgitfilemerge

提问by Eric Baldwin

When I attempt to run FileMerge as a GUI for Opendiff, I receive an error:

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

I have installed XCode 4.6.3 and Command Line Tools for Xcode April 2013. I am running OSX 10.7.5

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

I have tried solutions from the following two links with no success:

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

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

带有 opendiff 的 git diff 给出“无法启动 FileMerge”错误

Is filemerge still available after Xcode 4.3 installation?

安装 Xcode 4.3 后,filemerge 是否仍然可用?

When I go to Xcode -> Open Developer ToolI do not see FileMergein the list of options. There is a More Developer Toolslink that takes me here: https://developer.apple.com/downloads/index.action?name=for%20Xcode%20-

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

How do I get FileMerge working?

我如何让 FileMerge 工作?

采纳答案by VonC

Strange. "XCode 4.5, where is FileMerge ?" suggests:

奇怪的。“ XCode 4.5,FileMerge 在哪里?” 建议:

The FileMerge that is bundled with Xcode 4.5 doesn't work as a standalone application. I tried compressing it from the application bundle. I was able to expand it to show the FileMerge app on the desktop. But when I tried to run it I got an error saying it couldn't be opened.

Apple's developer downloads site has every version of Xcode. You could try trashing your current version of Xcode 4.5, downloading Xcode 4.5 from the developer downloads site, and see if FileMerge is there. If not, you can download Xcode 4.4 and see if that has FileMerge.

Indeed, I downloaded a fresh new install of XCode 4.5 and put my updated 4.4 to 4.5 upgraded version into the trash and I have now all the developer tools again, including FileMerge. Weird...

与 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。奇怪的...



The other option, from that same thread:

另一个选项,来自同一个线程:

Why not just install the Command Line Tools? That will give you the "opendiff" tool. Then, you create a little script like this one to make it useful and actually do a merge.

为什么不直接安装命令行工具?这将为您提供“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"

回答by rhuff

FileMerge is located at within Xcode.

FileMerge 位于 Xcode 中。

From the command-line:

从命令行:

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

Go into that directory once it opens:

打开后进入该目录:

  1. Right-click on the app
  2. Choose "Make alias"
  3. Move that alias to your Applicationsdirectory
  1. 右键单击应用程序
  2. 选择“制作别名”
  3. 将该别名移动到您的应用程序目录

You're all set.

你都准备好了。

回答by otmezger

if you have xcode installed, then you can probably run the following from the command line to open FileMerge directly

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

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

回答by Jason Brooks

Try reinstalling Xcode. I had the same issue and it fixed it for me! It appears the Merge utility got corrupt somehow.

尝试重新安装 Xcode。我有同样的问题,它为我修复了它!看来 Merge 实用程序以某种方式损坏了。