47
$ brew update
Error: homebrew-core is a shallow clone. To `brew update` first run:
  git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow

I tried to run above command: git ... --unshallow but I got another error:

fatal: dumb http transport does not support shallow capabilities

$ brew -v
Homebrew 2.6.0-104-g24f7898
Homebrew/homebrew-core (git revision b1ef15; last commit 2020-12-05)
Homebrew/homebrew-cask (git revision 443e7; last commit 2020-08-27)

Anyone can help?

yivi
  • 42,438
  • 18
  • 116
  • 138
JIAN40
  • 601
  • 4
  • 6
  • 3
    This exact same thing happened to me as well, coincidentally today. Did something happen with brew cask? – David Corbin Dec 06 '20 at 16:31
  • 3
    Yup using shallow clones is now not allowed due to the high load it was generating on GitHub's servers. Some more info [here](https://stackoverflow.com/a/65243764/1072229) – Grisha Levit Dec 10 '20 at 23:53

3 Answers3

59

I dug a little after trying to deal with the git repo, but the simplest thing that fixed it for me was untapping and then retapping the casks repo

brew untap homebrew/cask
brew tap homebrew/cask

that put everything back in order.

I haven't RTFM'd lately, but I'm guessing this has something to do with how casks seem to be moving into the main homebrew repo (or at least that's how it seems as a naive user).

John Paul Ashenfelter
  • 3,135
  • 1
  • 22
  • 29
13

I tried to run: $ git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch

then: $ git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow

brew update seems OK now.

JIAN40
  • 601
  • 4
  • 6
  • 4
    For other users tryining to use this tip, please have some patience if your terminal is not responding. 1 minute was the waiting time on my system for each line. – JeroenDV Dec 30 '20 at 12:44
  • Thanks this solved my problem with brew update getting stuck. – dstuessy Jun 22 '23 at 14:32
0

In my case I was getting this

$ brew update
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: Fetching /usr/local/Homebrew/Library/Taps/myf/homebrew-formulas failed!

Notice the myf/homebrew-formulas in the last line. This is one of my old repos not accessible anymore.

I got it solved with

$ brew untap myf/homebrew-formulas

Untapping myf/formulas...
Untapped 5 formulae (37 files, 63KB).

Other commands I tried

$ brew upgrade
$ brew update-reset
$ brew doctor
user9869932
  • 6,571
  • 3
  • 55
  • 49