git diff和opendiff会给出“无法启动FileMerge”错误 [英] git diff with opendiff gives "Couldn't launch FileMerge" error

查看:324
本文介绍了git diff和opendiff会给出“无法启动FileMerge”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  opendiff $ 2 $ 5 

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

  2011-02-18 13:58:55.532 opendiff [27959:60f]异常提出尝试运行FileMerge:启动路径无法访问
2011-02-18 13:58:55.535 opendiff [27959:60f ]无法启动FileMerge
外部差异死亡,停止在source / some_file.m。

发生了什么事?这已经工作了很多个月,但最近停止了工作。

然后我删除了beta开发人员文件夹来尝试解决这个问题(无法使用合并工具获得修复)我在命令行中偶然发现了这一点:

 错误:没有开发人员目录在/ Developer Beta中找到。运行/ usr / bin / xcode-select更新开发者目录路径。 

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

 用法:xcode-select -print-path 
或者:xcode-select -switch< xcode_folder_path>
或者:xcode-select -version
参数:
-print-path打印当前Xcode文件夹的路径
-switch< xcode_folder_path>设置当前Xcode文件夹的路径
-version

将该路径设置为测试版。要解决这个问题,请运行:

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

code>

为我解决了这个问题。

更新



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



$ p $ sudo / usr / bin / xcode-选择-switch /Applications/Xcode.app/Contents/Developer/


I have git configured to use ~/bin/opendiff-git.sh as my external diff tool. That script looks like this:

opendiff $2 $5

When I try and do a git diff from the command line, I get this message:

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.

What's going on? This has worked for many months, but stopped working recently.

解决方案

So AFTER I deleted the beta developer folder to try and solve this (couldn't get the fix to work with merge tool) I stumbled upon this in the command line:

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

Turns out you can set the developer path you need it to use:

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  

Looks like installing the beta had automatically set that path to beta. To fix it, run this:

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

That fixed it for me.

Update

Ying's comment below was important enough to include in the answer. From Xcode 4.3 on, the location of the folder has changed to inside the application package:

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

这篇关于git diff和opendiff会给出“无法启动FileMerge”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆