mac brew update時にエラー「Error: homebrew-cask is a shallow clone. To brew update first run:」が発生した場合の対処法

  • 作成日 2021.02.12
  • mac
mac brew update時にエラー「Error: homebrew-cask is a shallow clone. To brew update first run:」が発生した場合の対処法

brew update時にエラー「Error: homebrew-cask is a shallow clone. To brew update first run:」が発生した場合の対処法を記述してます。

環境

  • OS  mac 10.15.5

エラー全文

brew update時に発生。

Error: homebrew-cask is a shallow clone. To `brew update` first run:
  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-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-cask" fetch --unshallow