Skip to content

brew update throws " couldn't find remote ref refs/heads/master" #131

Closed

Description

@iapicca

this happens since flutter forward

➜  ~ brew update
fatal: couldn't find remote ref refs/heads/master
Error: Fetching /opt/homebrew/Library/Taps/dart-lang/homebrew-dart failed!
Error: Some taps failed to update!
The following taps can not read their remote branches:
  dart-lang/dart
This is happening because the remote branch was renamed or deleted.
Reset taps to point to the correct remote branches by running `brew tap --repair`
➜  ~ brew --version
Homebrew 3.6.20
Homebrew/homebrew-core (git revision 482f2727196; last commit 2023-01-27)
Homebrew/homebrew-cask (git revision c3e0e02345; last commit 2023-01-27)
➜  ~ dart --version
Dart SDK version: 2.19.0 (stable) (Mon Jan 23 11:29:09 2023 -0800) on "macos_arm64"
➜  ~ flutter doctor -v
[!] Flutter (Channel stable, 3.7.0, on macOS 13.2 22D49 darwin-arm64, locale en-EE)
    • Flutter version 3.7.0 on channel stable at /Users/yakforward/fvm/versions/stable
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.19.0/libexec/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/yakforward/fvm/versions/stable. Consider adding
      /Users/yakforward/fvm/versions/stable/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b06b8b2710 (4 days ago), 2023-01-23 16:55:55 -0800
    • Engine revision b24591ed32
    • Dart version 2.19.0
    • DevTools version 2.20.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to
      perform update checks and upgrades.

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.74.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 13.2 22D49 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 109.0.5414.119

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 3 categories.
                    'c.          [email protected]
                 ,xNMM.          ---------------------------
               .OMMMMo           OS: macOS 13.2 22D49 arm64
               OMMM0,            Host: MacBookAir10,1
     .;loddo:' loolloddol;.      Kernel: 22.3.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 6 hours, 11 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 102 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.8.1
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 1440x900
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Quartz Compositor
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    WM Theme: Blue (Dark)
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal: /dev/ttys000
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   CPU: Apple M1
    kMMMMMMMMMMMMMMMMMMMMMMd     GPU: Apple M1
     ;KMMMMMMMWXXWMMMMMMMk.      Memory: 1372MiB / 8192MiB
       .cooc,.    .,coo:.

Activity

  1. miketheman commented on Jan 27, 2023

    @miketheman

    A result of #129

  2. miketheman commented on Jan 27, 2023

    @miketheman

    Running brew tap --repair dart-lang/dart should resolve:

    $ brew tap --repair dart-lang/dart
    remote: Enumerating objects: 54, done.
    remote: Counting objects: 100% (54/54), done.
    remote: Compressing objects: 100% (31/31), done.
    remote: Total 54 (delta 23), reused 49 (delta 22), pack-reused 0
    Unpacking objects: 100% (54/54), 14.03 KiB | 251.00 KiB/s, done.
    From https://github.com/dart-lang/homebrew-dart
     * [new branch]      main       -> origin/main
    ==> dart-lang/dart: changed default branch name from master to main!

    After which brew update && brew upgrade dart works.

  3. iapicca commented on Jan 27, 2023

    @iapicca
    Author

    brew tap --repair dart-lang/dart

    it does fix the issue
    thanks @miketheman

  4. Najki commented on Jan 31, 2023

    @Najki

    FYI repair haven't solved that issue for me.

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

    I found that post and tried:

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

    After that, brew update still failed, but this time brew tap --repair dart-lang/dart solved it.

  5. reopened this on Feb 2, 2023
  6. iapicca commented on Feb 2, 2023

    @iapicca
    Author

    here we go again

    ➜  ~ brew tap --repair dart-lang/dart
    ➜  ~ brew update && \
    brew upgrade && \
    brew upgrade --cask && \
    brew cleanup && \
    softwareupdate --all --install --force
    Already up-to-date.
    ==> Upgrading 1 outdated package:
    dart-lang/dart/dart 2.19.0 -> 2.19.1
    ==> Fetching dart-lang/dart/dart
    ==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/release/2.19.1/sdk/dartsdk-macos-arm64-release.
    curl: (22) The requested URL returned error: 403
    
    Error: dart: Failed to download resource "dart"
    Download failed: https://storage.googleapis.com/dart-archive/channels/stable/release/2.19.1/sdk/dartsdk-macos-arm64-release.zip
    ➜  ~ brew tap --repair dart-lang/dart
    ➜  ~ brew update
    Already up-to-date.

    is there a way to permanently fix this?

  7. whesse commented on Feb 2, 2023

    @whesse
    Contributor

    The last failure, a failure to download the SDK zip file, seems unrelated to the above problems changing master to main.

    Could this be a temporary failure? The file is there, and the download of it using curl should succeed.

  8. gmpassos commented on Feb 12, 2023

    @gmpassos

    What really worked for me to fix this issue:

    cd /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart
    
    git branch -m master main
    git remote remove origin
    git remote add origin https://github.com/dart-lang/homebrew-dart
    brew tap --repair dart-lang/dart
    
    brew update
  9. gmpassos commented on Feb 13, 2023

    @gmpassos

    Any idea how to fix this so everyone in the wild has a transparent solution?

    This issue happens because the "master" branch was renamed to "main" and brew is totally dependent on git.

    This is a SEVERE error, BTW.

    @whesse
    @kevmoo

  10. fajarvm commented on Feb 18, 2023

    @fajarvm

    FYI repair haven't solved that issue for me.

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

    I found that post and tried:

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

    After that, brew update still failed, but this time brew tap --repair dart-lang/dart solved it.

    Thanks! This fixes the problem I was having as the other proposed solutions were not able to. 🙏

  11. CuchulainX commented on Mar 30, 2023

    @CuchulainX

    brew is completely broken due to the rename of master to main

    AD is now at b0e349efe Merge pull request #15081 from reitermarkus/livecheck-artifacts
    fatal: couldn't find remote ref refs/heads/master
    Error: Fetching /opt/homebrew/Library/Taps/dart-lang/homebrew-dart failed!
    Updated 2 taps (homebrew/core and homebrew/cask).
    Error: Some taps failed to update!
    The following taps can not read their remote branches:
    dart-lang/dart
    This is happening because the remote branch was renamed or deleted.
    Reset taps to point to the correct remote branches by running brew tap --repair
    Failed during: /opt/homebrew/bin/brew update --force --quiet

    There are no brew commands available. Fixes suggesting
    brew doctor
    brew update
    brew *

    are not workable

  12. gmpassos commented on Mar 31, 2023

    @gmpassos

    What really worked for me to fix this issue:

    cd /usr/local/Homebrew/Library/Taps/dart-lang/homebrew-dart
    
    git branch -m master main
    git remote remove origin
    git remote add origin https://github.com/dart-lang/homebrew-dart
    brew tap --repair dart-lang/dart
    
    brew update

    For now this is the fix

  13. athomas commented on Jun 14, 2023

    @athomas
    Member

    Assuming that users have used the workaround described here. If you're still facing issues, please report them to the homebrew team.

  14. CuchulainX commented on Jul 11, 2023

    @CuchulainX

    brew is completely broken due to the rename of master to main

    AD is now at b0e349efe Merge pull request #15081 from reitermarkus/livecheck-artifacts fatal: couldn't find remote ref refs/heads/master Error: Fetching /opt/homebrew/Library/Taps/dart-lang/homebrew-dart failed! Updated 2 taps (homebrew/core and homebrew/cask). Error: Some taps failed to update! The following taps can not read their remote branches: dart-lang/dart This is happening because the remote branch was renamed or deleted. Reset taps to point to the correct remote branches by running brew tap --repair Failed during: /opt/homebrew/bin/brew update --force --quiet

    There are no brew commands available. Fixes suggesting brew doctor brew update brew *

    are not workable

    This also effects new installs of brew
    I needed to:

    cd /opt/Homebrew/Library/Taps/dart-lang/homebrew-dart
    git fetch
    git checkout main
    git checkout -b master
    

    then I was able to execute
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

  15. kevmoo commented on Jul 13, 2023

    @kevmoo
    Member

    @athomas – thoughts?

  16. gmpassos commented on Jul 13, 2023

    @gmpassos

    The problem has not been fully fixed for 6 months (and this issue is closed for 5 months, BTW)

  17. athomas commented on Jul 14, 2023

    @athomas
    Member

    This also effects new installs of brew

    I created a new GitHub Actions workflow and it installs fine using the official instructions from dart.dev:
    https://github.com/dart-lang/homebrew-dart/actions/runs/5553515999/jobs/10142152664

    Anything I'm missing? Perhaps you had an old cache?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions