问题
19款mbp16更新到ventura之后就没管过homebrew,今天执行update报错
brew update
Error:
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
These commands may take a few minutes to run due to the large size of the repositories.
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
~ git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
remote: Enumerating objects: 401369, done.
remote: Counting objects: 100% (401359/401359), done.
remote: Compressing objects: 100% (122055/122055), done.
remote: Total 393989 (delta 282380), reused 382929 (delta 271367), pack-reused 0
Receiving objects: 100% (393989/393989), 167.04 MiB | 7.64 MiB/s, done.
Resolving deltas: 100% (282380/282380), completed with 5232 local objects.
From https://github.com/Homebrew/homebrew-cask
6f2982f629f..62ca9d62d72 master -> origin/master
解决
最后在一篇文章下找到了解决方案,其实他的做法也是修改源,但是成功了,做个记录,为自己和他人提供一个解决思路,操作如下文章来源:https://www.toymoban.com/news/detail-723382.html
~ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core master git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
remote: Enumerating objects: 387770, done.
remote: Counting objects: 100% (358027/358027), done.
remote: Compressing objects: 100% (147642/147642), done.
remote: Total 350964 (delta 203097), reused 347396 (delta 200519), pack-reused 0
Receiving objects: 100% (350964/350964), 120.16 MiB | 10.92 MiB/s, done.
Resolving deltas: 100% (203097/203097), completed with 1503 local objects.
From https://mirrors.ustc.edu.cn/homebrew-core
d5cb1375b81..6e79ffce447 master -> origin/master
参考文章:
MacOS下PHP7.1升级到PHP7.4.15的方法文章来源地址https://www.toymoban.com/news/detail-723382.html
到了这里,关于homebrew 更新报错 homebrew-core is a shallow clone.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!