homebrew-fb icon indicating copy to clipboard operation
homebrew-fb copied to clipboard

Branch rename broke the tap - "Error: Fetching /usr/local/Homebrew/Library/Taps/facebook/homebrew-fb failed!"

Open liamjones opened this issue 3 years ago • 4 comments

Not sure you can do anything about this but an FYI in case others come looking:

brew update started responding with Error: Fetching /usr/local/Homebrew/Library/Taps/facebook/homebrew-fb failed! recently.

I believe this is down to the fact that it was trying to pull from the existing branch named master and that no longer exists, it's now called main.

brew update-reset fixes this:

==> Fetching /usr/local/Homebrew/Library/Taps/facebook/homebrew-fb...
From https://github.com/facebook/homebrew-fb
 - [deleted]         (none)     -> origin/automated_fixup_code_of_conduct_file_exists
 - [deleted]         (none)     -> origin/automated_fixup_contributing_file_exists
 - [deleted]         (none)     -> origin/master
   (refs/remotes/origin/HEAD has become dangling)
 * [new branch]      main       -> origin/main

Note: this will destroy all your uncommitted or committed changes to local homebrew repositories (Shouldn't be an issue unless you author formula updates, etc)

This shouldn't affect new users of the tap since I assume it'd pickup branch main from the outset.

liamjones avatar Aug 13 '21 15:08 liamjones

same error to me

faimin avatar Aug 17 '21 08:08 faimin

brew tap --repair also seems to help. It's suggested by brew on update.

KapJI avatar Aug 23 '21 12:08 KapJI

nope, brew tap --repair not work for me.

> brew tap --repair
fatal: couldn't find remote ref refs/heads/master
Error: Failure while executing; `git -C /usr/local/Homebrew/Library/Taps/facebook/homebrew-fb fetch origin` exited with 128.

faimin avatar Aug 26 '21 05:08 faimin

I had to update branch and recreate remote myself, from the tap directory:

cd /usr/local/Homebrew/Library/Taps/facebook/homebrew-fb 
git branch -m master main
git remote remove origin
git remote add origin https://github.com/facebook/homebrew-fb.git

only then I could run brew update-reset and brew update without errors.

rdamborsky avatar Aug 27 '21 14:08 rdamborsky