I tried to run “brew upgrade”, but the following came up!!
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!
Follow the instruction from the output
This will take a few minutes, have a drinks first. Cheers.
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
Sample Output
remote: Enumerating objects: 333604, done.
remote: Counting objects: 100% (333584/333584), done.
remote: Compressing objects: 100% (140321/140321), done.
remote: Total 326134 (delta 187532), reused 321606 (delta 183016), pack-reused 0
Receiving objects: 100% (326134/326134), 93.86 MiB | 2.66 MiB/s, done.
Resolving deltas: 100% (187532/187532), completed with 3522 local objects.
From https://github.com/Homebrew/homebrew-core
13a1ea5589..cc35332754 master -> origin/master
Next Command
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
Sample Output
remote: Enumerating objects: 337007, done.
remote: Counting objects: 100% (337002/337002), done.
remote: Compressing objects: 100% (98921/98921), done.
remote: Total 330478 (delta 235782), reused 325705 (delta 231013), pack-reused 0
Receiving objects: 100% (330478/330478), 124.85 MiB | 3.40 MiB/s, done.
Resolving deltas: 100% (235782/235782), completed with 3117 local objects.
From https://github.com/Homebrew/homebrew-cask
3d7d04ec59..636ce8c29b master -> origin/master
Try the brew update again
brew update