Big Sur 更新 brew 踩坑
升级big sur 后,执行 brew update
时会有如下提示:
homebrew-core is a shallow clone.
homebrew-cask 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-cask fetch --unshallow
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
但执行 git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
时,又提示fatal: dumb http transport does not support shallow capabilities
,
进入到 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core 目录下
此时通过执行 git remote -v
发现之前将 brew 换成了 阿里源,最终换成默认仓库解决问题
默认的仓库地址:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://github.com/Homebrew/homebrew-cask.git
不知什么原因,fetch homebrew-core 那一步还是失败,最后索性删掉 homebrew-core 目录 从新 clone 一份,至此,brew update
终于可以正常更新了
git clone https://github.com/Homebrew/homebrew-core.gitunshallow
确实是更改成阿里源造成!问题已经解决,感谢!
不客气
最后依靠 删除homebrew-core,在git clone解决的
谢谢大佬。我也是删除homebrew-core再clone就没报错了。源也换成官方的源。
感谢