mac报错Error: homebrew-core is a shallow clone.解决
报错信息:
~/Documents/» brew install tree
Error: homebrew-core is a shallow clone.
To `brew update`, first run:git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
解决方案
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
可能会因为网络原因报错,换几个时间点,多执行几次,执行期间显示如下:

其实就是把https://github.com/Homebrew/homebrew-core/部分下载下来重新更新本地仓库。
然后可以brew update验证一下是不是不会报错了

如果还有报错: homebrew-cask is a shallow clone.
类似的,可以使用
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
相对靠谱的内容:
- stack overflow:How to remove the shallow clone warning from HomeBrew
- HomeBrew - Error: homebrew-core is a shallow clone.
有风险,不建议采用
- [Solved] Mac Homebrew Error: homebrew-core is a shallow clone.
- 这一解决方案的实践:Mac homebrew报错Error: homebrew-core is a shallow clone.
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
