自制软件无法更新,我无法添加git存储库

Mar*_*nes 17 homebrew

几乎就是标题所说的.我正在尝试使用更新自制软件

brew update
Run Code Online (Sandbox Code Playgroud)

我总是得到错误信息

$ 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
Run Code Online (Sandbox Code Playgroud)

brew doctor命令输出如下:

$ 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
Run Code Online (Sandbox Code Playgroud)

我跑的时候

cd /usr/local
git remote add origin https://github.com/Homebrew/homebrew.git
Run Code Online (Sandbox Code Playgroud)

我明白了

$ 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
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能摆脱这个问题?似乎git不承认自制软件库,我应该使用什么而不是这个建议的?

Boj*_*oer 29

确实是一个正确的答案,但没有必要走到这么远.

正如评论中所提到的,删除/ usr/local中存在的顶级.git目录就足够了.仅在删除顶部.git目录后将运行您的brew更新将重建树!

分段错误:11你的PHP安装是同样的问题它仍然是Mavericks瓶的拉取版本,所以更新和升级将纠正这个,也只需要你的主php55或php56,而不是你使用Homebrew安装的所有PHP依赖.

GL!


小智 20

我遇到了同样的问题,只需使用即可在临时位置克隆自制软件库

git clone https://github.com/Homebrew/homebrew.git
Run Code Online (Sandbox Code Playgroud)

并将生成的.git目录移动到/ usr/local,覆盖已存在的目录.在那之后,我不得不检查几个目录:

cd /usr/local
git checkout Library/Formula/
git checkout Library/Contributions/
git checkout Library/ENV/
git checkout Library/Homebrew/
Run Code Online (Sandbox Code Playgroud)

  • 很好的答案 - 谢谢.我发现我可以删除损坏的.git文件夹而不是mv和覆盖. (6认同)