出现这个报错,可以首先运行命令:

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

然后再升级brew

brew update