首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >homebrew无法更新,我无法添加git存储库

homebrew无法更新,我无法添加git存储库
EN

Stack Overflow用户
提问于 2014-01-22 03:22:31
回答 1查看 10.1K关注 0票数 19

和标题上说的差不多。我正在尝试使用以下命令更新自制软件

代码语言:javascript
复制
brew update

并且我总是收到错误消息

代码语言:javascript
复制
$ brew update
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
Error: Failure while executing: git checkout -q master

brew doctor命令输出如下所示:

代码语言:javascript
复制
$ brew doctor
Warning: Missing git origin remote.

Without a correctly configured origin, Homebrew won't update
properly. You can solve this by adding the Homebrew remote:
  cd /usr/local
  git remote add origin https://github.com/Homebrew/homebrew.git
fatal: Not a git repository (or any of the parent directories): .git

当我跑的时候

代码语言:javascript
复制
cd /usr/local
git remote add origin https://github.com/Homebrew/homebrew.git

我得到了

代码语言:javascript
复制
$ cd /usr/local
$ git remote add origin https://github.com/Homebrew/homebrew.git
fatal: Not a git repository (or any of the parent directories): .git

我能做些什么来摆脱这个问题呢?git似乎不能识别自制的存储库,我应该使用什么来代替这个建议的存储库呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-01-30 12:39:30

我也遇到了同样的问题,只需使用以下命令在一个临时位置克隆homebrew存储库

代码语言:javascript
复制
git clone https://github.com/Homebrew/homebrew.git

并将生成的本地目录移动到/usr/ .git,覆盖那里已有的目录。在那之后,我必须签出一些目录:

代码语言:javascript
复制
cd /usr/local
git checkout Library/Formula/
git checkout Library/Contributions/
git checkout Library/ENV/
git checkout Library/Homebrew/
票数 21
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21267220

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档