Lion OS - brew更新返回"执行时失败..."

use*_*621 5 git homebrew osx-lion osx-mountain-lion

当我设置时,我正在尝试更新我的brew

brew更新

我收到此错误:

error: Your local changes to the following files would be overwritten by merge:
    Library/Formula/imagemagick.rb
Please, commit your changes or stash them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
Run Code Online (Sandbox Code Playgroud)

要么

error: The requested URL returned error: 403 while accessing https://github.com/mxcl/homebrew/info/refs
fatal: HTTP request failed
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
Run Code Online (Sandbox Code Playgroud)

Git有什么问题?如果这种方式不起作用,如何更新brew?

小智 13

这是由update代码中的旧错误引起的,该错误早已被修复.但是,错误的性质要求您执行以下操作:

cd $(brew --repository)
git reset --hard FETCH_HEAD
Run Code Online (Sandbox Code Playgroud)

如果brew doctor仍抱怨未提交的修改,也请运行以下命令:

cd $(brew --repository)    
git clean -fd
Run Code Online (Sandbox Code Playgroud)


Kla*_*urn 0

您收到的第一个错误表明以下内容:您Library/Formula/imagemagick.rb在工作目录中修改了一个文件,但这些修改尚未提交。当您进行拉取时,您不能有未提交的更改,这brew update是隐式执行的。您必须遵守错误文本中给出的说明:在执行brew update之前,提交所有修改的文件,包括imagemagick.rb.