Error: homebrew-core is a shallow clone. homebrew-cask is a shallow clone.

programming
スポンサーリンク
language
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!

When I do a brew update or brew tap, I get the following error.

The contents of this error are as follows.

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!

The error is caused by homebrew-core and homebrew-cask.

In this article, I will show you how to solve this error and what causes it.

スポンサーリンク

The solution is to execute the command mentioned in the error message.

The solution is to execute the command mentioned in the error statement.

Please execute the following two commands.
The error will be resolved.

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow

The cause is a change in Homebrew’s specifications.

I have been getting these errors since December 2020.

This is because Homebrew used to use shallow clones of Git repositories, but now the specification has been changed to use clones for updating.

brew update refuses to update shallow homebrew-core/cask clones (on request from GitHub).

https://brew.sh/2020/12/21/homebrew-2.7.0/

See the discussion below to find out why the specification was changed in this way.
Why is a full clone of homebrew/core required for brew update?

As of December 4, 2020, the corresponding pull request has been merged.
update.sh: refuse to update shallow homebrew-core/cask clones.

summary

The reason why you get the following error in Homebrew is because the specification has been changed to use clone to update.

Error: 
  homebrew-core is a shallow clone.
  homebrew-cask is a shallow clone.

Execute the following command to resolve the update error.

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow

タイトルとURLをコピーしました