执行如下命令时
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
报错:
==> Downloading and installing Homebrew... HEAD is now at 8175e404e Merge pull request #7942 from sjackman/bottle_tag error: Not a valid ref: refs/remotes/origin/master fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
这个错误是由于多次下载,导致一些冲突,最简单粗暴的解决就是卸载重装。因为我之前有几次安装中断了。
卸载homebrew
下载https://raw.githubusercontent.com/Homebrew/install/master/uninstall 并保存为 uninstall.rb
,再执行 ruby uninstall.rb
参考链接:
1. https://hyuga.top/blog/184
2. https://stackoverflow.com/questions/39836190/homebrew-install-failed-during-git-fetch-origin-masterrefs-remotes-origin-mas