brew 报错 error: Not a valid ref: refs/remotes/origin/master 的解决方法
更新于 阅读 6 次
安装brew时
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
如果报错
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.
这次由于多次安装导致的,最简单的方式是直接卸载brew,然后再安装。
- 将https://raw.githubusercontent.com/Homebrew/install/master/uninstall保存为uninstall.rb
- 执行ruby uninstall.rb