リライト
こちらにリライトしました。
エラー内容
brew update
やbrew tap
をすると以下のようなエラーが出てしまいます。
homebrew-core
とhomebrew-cask
が原因になってでエラーが出ています。
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
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
原因
2020年12月以降にこのようなエラーが出ているようです。
HomebrewはこれまでGitリポジトリのshallow cloneを利用が、これからはcloneを利用して更新するように仕様変更になったからです。
なぜこのような仕様変更になったのかは、以下のディスカッションを参照してください。
Why is a full clone of homebrew/core required for brew update?
2020年12月4日の時点で該当がプルリクがマージされています。
update.sh: refuse to update shallow homebrew-core/cask clones.