在Mac 10.9之后,Brew更新无法正常工作

ise*_*sea 53 homebrew

自10.9升级以来第一次运行brew.

从下面的输出中,我应该删除Library/Formula/ant.rb和Library/Formula/apple-gcc42.rb吗?另外,还不清楚为什么git pull失败了.谢谢你的帮助

525    [projects]$  brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew.git
HEAD: 27c26faf7b958de6028ad55be8ccc5a57b094d3f
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.9-x86_64
Xcode: 5.0.2
GCC-4.2: build 5666
LLVM-GCC: build 0
Clang: 5.0 build 500
X11: N/A
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /Users/*****/.rvm/rubies/ruby-2.0.0-p195/bin/ruby
526    [projects]$  brew update
error: The following untracked working tree files would be overwritten by merge:
    Library/Formula/ant.rb
    Library/Formula/apple-gcc42.rb
Please move or remove 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)

ise*_*sea 166

这为我修好了

cd `brew --prefix`/Homebrew
git fetch origin
git reset --hard origin/master
Run Code Online (Sandbox Code Playgroud)

brew后更新工作正常

  • 感谢你在弄明白的时候[正确而简洁地]回答你的问题.太多人没有这样跟进.对你好!:) (5认同)
  • 太棒了,今天为我自己工作,OSX 10.10.3 (2认同)
  • 我不得不使用```sudo git reset --hard origin/master```作为最后一个命令. (2认同)
  • 出于某种原因,"brew update"未能在一周内实际更新任何内容.这解决了它.谢谢! (2认同)

Tar*_*ngh 6

你可能还会发现......

BREW更新不工作git pull origin master

在这里你需要做什么.

cd /usr/local git pull origin master brew install git

现在你可能已经在你的系统上安装了git,但现在这样做了.

您的破碎brew更新将在首次运行之前自动更新.

这是HomeBrew中原始问题的链接.酿造卡住


col*_*ain 5

我只是删除了.git目录中的/usr/local目录,然后运行命令brew update.


msm*_*fsd 5

我的 brew 更新挂了,什么也不做。我在 OSX 10.12.5 上,以上都不适合我,我没有 .git in usr/local,只有.git 文件usr/local/Homebrew

我跑brew update --debug --verbose,并brew update和固定的问题,看到这个问题:https://github.com/Homebrew/brew/issues/895