Error message "fatal: cannot force update the branch 'master' checked out at '/opt/homebrew'" when installing Homebrew #5113
Replies: 2 comments 1 reply
-
If |
Beta Was this translation helpful? Give feedback.
-
Just wanted to add that I ran into this same error, but I installed the 4.2.7 release from the .pkg file on a fresh M3 Mac running Sonoma 14.3.1. After I completed the package install, I ran First run of brew
% brew
==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:d783cbeb6e6ef0d71c0b442317b54554370decd6fac66bf2d4938c07a63f67be
############################################################################################################################################################################## 100.0%
==> Pouring portable-ruby-3.1.4.arm64_big_sur.bottle.tar.gz
Example usage:
brew search TEXT|/REGEX/
brew info [FORMULA|CASK...]
brew install FORMULA|CASK...
brew update
brew upgrade [FORMULA|CASK...]
brew uninstall FORMULA|CASK...
brew list [FORMULA|CASK...]
Troubleshooting:
brew config
brew doctor
brew install --verbose --debug FORMULA|CASK
Contributing:
brew create URL [--no-fetch]
brew edit [FORMULA|CASK...]
Further help:
brew commands
brew help [COMMAND]
man brew
https://docs.brew.sh No errors there. But upon running % brew update
fatal: cannot force update the branch 'master' checked out at '/opt/homebrew'
[..] Full output from first run of brew update
% brew update
fatal: cannot force update the branch 'master' checked out at '/opt/homebrew'
==> Homebrew collects anonymous analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics have been recorded yet (nor will be during this `brew` run).
==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
autobrr cekit ignite kubetui magic-wormhole.rs
==> New Casks
hancom-docs Since % brew doctor && brew --version
Your system is ready to brew.
Homebrew 4.2.7 |
Beta Was this translation helpful? Give feedback.
-
Output of
brew config
Output of
brew doctor
Description of issue
I noticed an error message outputted when installing Homebrew on my MacBook Air with M2 chip (macOS Sonoma 14.3) using
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
in terminal:fatal: cannot force update the branch 'master' checked out at '/opt/homebrew'
Full output
This error message occurred when the installation script was executing
/opt/homebrew/bin/brew update --force --quiet
after/usr/bin/git reset --hard origin/master
(I tried to run the installation script with the-x
option).Part of the output with each command executed
Install Homebrew with command
/bin/bash -c -x "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Although it ultimately reported successful installation, I'm wondering why this error occurred and whether it will impact Homebrew's functionality.
Beta Was this translation helpful? Give feedback.
All reactions