Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

original brew update Error needs to run git fetch --unshallow, but got another git fatal

Tags:

homebrew

$ 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?

like image 721
JIAN40 Avatar asked Dec 06 '20 12:12

JIAN40


People also ask

How do I unshallow a git repository to update it?

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 It is now required to perform the unshallow process by running the git command (s) in the error message.

Why does Git fetch refuse to update the head?

By default git fetch refuses to update the head which corresponds to the current branch. This flag disables the check. This is purely for the internal use for git pull to communicate with git fetch, and unless you are implementing your own Porcelain you are not supposed to use it.

What does fatal not a git repository mean?

What does “fatal: not a git repository” mean? fatal: not a git repository (or any of the parent directories): .git. This error means you attempted to run a Git command, but weren’t inside a Git repository. Make sure you’ve:

Why am I getting a Git error when running a command?

This error means you attempted to run a Git command, but weren’t inside a Git repository. Make sure you’ve: Navigated to the right directory. Check with `ls`. Initialized your repository with `git init` or by cloning an existing repo.


2 Answers

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).

like image 81
John Paul Ashenfelter Avatar answered Oct 16 '22 14:10

John Paul Ashenfelter


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.

like image 43
JIAN40 Avatar answered Oct 16 '22 13:10

JIAN40