This worked for me:

brew tap --repair
brew cleanup
brew update-reset

After that I was able to brew update without any issues.

Possible culprit: dart-lang/dart: changed default branch name from master to main!

Answer from Mihai-Cristian on Stack Overflow
🌐
GitHub
github.com › dart-lang › homebrew-dart › issues › 131
brew update throws " couldn't find remote ref refs/heads/master" · Issue #131 · dart-lang/homebrew-dart
January 27, 2023 - ➜ ~ brew update fatal: couldn't ... taps can not read their remote branches: dart-lang/dart This is happening because the remote branch was renamed or deleted....
Author   dart-lang
🌐
Zenn
zenn.dev › ainellc › articles › 8b55b8d3a4932a
Homebrew で dart-lang/homebrew-dart failed! が出たときの対処法
September 8, 2023 - Reset taps to point to the correct remote branches by running `brew tap --repair` Failed during: /usr/local/bin/brew update --force --quiet · 以下のように躓いた部分を手動で入れてやり直すとエラーが出なくなった。 · cd /usr/local/Homebrew/Library/Taps/dart-lang/ rm -rf homebrew-dart git clone git@github.com:dart-lang/homebrew-dart.git
🌐
deadwood
d-wood.com › blog › 2023 › 06 › 24_12416.html
Homebrew で fatal: couldn’t find remote ref refs/heads/master エラーが発生した場合の解決方法 | DriftwoodJP
June 24, 2023 - Reset taps to point to the correct remote branches by running `brew tap –repair` “` ブランチ名が master から main に変わったことで発生するやつ。 ... “` % cd /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart ...
🌐
Zenn
zenn.dev › cacbahbj › articles › 0d1d858645777b
ひさびさにbrew使ったら更新でちょっとハマった話
October 10, 2023 - Reset taps to point to the correct remote branches by running `brew tap --repair` 使ってるパッケージのブランチが変更になってる模様 · % brew tap --repair : ==> dart-lang/dart: changed default branch name from master to main!
🌐
piaohua's blog
piaohua.github.io › post › tool › 20231022-brew-update-fail
fatal: couldn't find remote ref refs/heads/master - piaohua's blog
October 22, 2023 - fatal: couldn’t find remote ref refs/heads/master brew 更新提示失败如下: 1 2 3 4 5 > brew update Warning: No available formula with the name "ca-certificates". ==> Searching for similarly named formulae and casks... Error: No formulae or casks found for ca-certificates. fatal: Couldn't find remote ref refs/heads/master 解决方法: 1 /usr/local/Homebrew/Library/Taps/homebrew git:(master) > git pull origin master 更新后
🌐
GitHub
github.com › facebook › homebrew-fb › issues › 63
Branch rename broke the tap - "Error: Fetching /usr/local/Homebrew/Library/Taps/facebook/homebrew-fb failed!" · Issue #63 · facebook/homebrew-fb
August 13, 2021 - ==> 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
Author   facebook
🌐
Qiita
qiita.com › homebrew
brew updateでcouldn't find remote ref refs/heads/masterってエラー。Homebrewも万能じゃないんだね。 #homebrew - Qiita
December 19, 2023 - Reset taps to point to the correct remote branches by running `brew tap --repair` これまで、brew updateもbrew upgradeで失敗したこともなかったのに加えて、brewはとりあえず簡単インストールのためのツー...
Find elsewhere
🌐
GitHub
github.com › orgs › Homebrew › discussions › 3352
Unable to install on M1 MacBook Air 12.3.1 · Homebrew · Discussion #3352
June 10, 2022 - HEAD is now at ad13524bc Merge ... taps can not read their remote branches: osx-cross/avr This is happening because the remote branch was renamed or deleted....
🌐
Meta Jon
meta.jlericson.com › t › the-least-you-can-do › 244
The least you can do - Meta Jon
November 29, 2023 - I have a cronjob that updates Homebrew every night. Lately it’s been failing and I finally had a moment to dig in this morning. Here was the error: $ brew update -q fatal: couldn't find remote ref refs/heads/master Error: Fetching /usr/local/Homebrew/Library/Taps/heroku/homebrew-brew failed!
🌐
GitHub
github.com › besu-eth › besu-docs › issues › 765
Users may need to repair Homebrew when upgrading Besu · Issue #765 · besu-eth/besu-docs
August 7, 2021 - Error: Some taps failed to update! The following taps can not read their remote branches: hyperledger/besu This is happening because the remote branch was renamed or deleted.
Author   besu-eth
🌐
GitHub
github.com › Homebrew › homebrew-bundle › issues › 1246
--cleanup: "Refusing to untap [tap] because it contains the following installed formulae or casks" · Issue #1246 · Homebrew/homebrew-bundle
September 11, 2023 - My Brewfile contains tap "sass/sass" brew "sass/sass/sass" Sass has a build dependency on dart-lang/dart/dart (src). So in order to install/upgrade/build sass, Homebrew taps dart-lang/dart and installs dart. When running brew bundle inst...
Author   Homebrew
🌐
GitHub
github.com › dart-lang › sdk › issues › 52210
SocketException: Reading from a closed socket · Issue #52210 · dart-lang/sdk
April 28, 2023 - SocketException: SocketException: Reading from a closed socket File "secure_socket.dart", line 770, in _RawSecureSocket.read File "socket_patch.dart", line 2323, in _Socket._onData File "zone.dart", line 1399, in _rootRunUnary File "zone.dart", line 1300, in _CustomZone.runUnary File "zone.dart", line 1209, in _CustomZone.runUnaryGuarded File "stream_impl.dart", line 339, in _BufferingStreamSubscription._sendData File "stream_impl.dart", line 271, in _BufferingStreamSubscription._add File "stream_controller.dart", line 774, in _SyncStreamControllerDispatch._sendData File "stream_controller.dar
Author   dart-lang
🌐
Medium
medium.com › @samfirminger › odd-solution-to-homebrew-update-fail-homebrew-core-stopping-install-of-a-package-via-brew-f1064b786144
Odd solution to Homebrew update fail (homebrew-core) stopping install of a package via brew | by Sam Firminger | Medium
September 10, 2021 - sams-macbook ~ % brew update-reset ==> Fetching /opt/homebrew...==> Resetting /opt/homebrew...Branch 'master' set up to track remote branch 'master' from 'origin'.Reset branch 'master'Your branch is up to date with 'origin/master'.==> Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-core...fatal: protocol error: bad pack header
🌐
Dart
dart.dev › get-dart
Get the Dart SDK
$ brew tap dart-lang/dart $ brew trust dart-lang/dart content_copy
🌐
Dart
dart.dev › tools › pub › cmd › pub-global
dart pub global
May 15, 2026 - To specify a different branch or commit, use the --git-ref option: $ dart pub global activate -sgit https://github.com/dart-lang/http.git --git-ref 36f98e900347335af2338a0e087538009b7de2f9 content_copy ... Use activate --source path <path> to activate a package on your local machine. The following example activates the stopwatch package from the ~/dart directory:
🌐
GitHub
github.com › dart-lang › homebrew-dart
GitHub - dart-lang/homebrew-dart: Dart team's official tap for homebrew. · GitHub
To use the specific version in your IDE or in scripts use the SDK you find under /usr/local/opt/dart@2.8/libexec.
Starred by 169 users
Forked by 58 users
Languages   Ruby 93.1% | Dart 6.9%
🌐
Dart
dart.dev › tools › diagnostics
Diagnostic messages
Parts must have exactly the same language version override as the library. ... The variable '{0}' has a different type and/or finality in this branch of the logical-or pattern.
🌐
Dart
dart.dev › tools › dartpad › troubleshoot
Troubleshooting DartPad
If the code is using language or library features no longer supported in the latest stable release of Dart, the code might no longer analyze or run without errors.