I received same error as OP when updating homebrew
. Here's how I resolved it:
Troubleshooting:
The "error" related to shallow-cloning is actually a change GitHub imposed on Homebrew:
"update.sh: refuse to update shallow homebrew-core/cask clones. #9383"
https://github.com/Homebrew/brew/pull/9383
So this "error" is being intentionally thrown to force users to stop using shallow clones- it's unrelated to any upgrade of OSX to "Big Sur" which was pushed out around the same time.
Resolution:
I just followed the guidance in the "error" message and brew update and brew upgrade worked:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
NOTE: when I did my brew update/upgrade on my own Big Sur machine, I was using the latest version of Xcode- 12.3. Here's the output of brew config for comparative analysis if your brew update/upgrade is still failing:
HOMEBREW_VERSION: 2.7.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: fdb71a5cb3029da2ef74d7e09c40575bbfb4ec72
Last commit: 9 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9b85587e2fa7dc1e46f50572ecf1e951613d7e21
Core tap last commit: 29 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 2.6.3 =>
/usr/local/Homebrew/Library/Homebrew/vendor/portable- ruby/2.6.3_2/bin/ruby
CPU: dodeca-core 64-bit kabylake
Clang: 12.0 build 1200
Git: 2.24.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 11.1-x86_64
CLT: 11.0.33.12
Xcode: 12.3