-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brew update on clean M2 MacOS .pkg install prints "fatal: cannot force update the branch 'master' checked out at '/opt/homebrew'" #847
Comments
I am experiencing this issue in an existing install. It has occurred a couple of times. I haven't been able to isolate the pattern yet. |
I can repeat the error consistently with following:
Obviously this is just a test scenario, so I am not exactly sure what pattern is causing the issue for me in more normal usage.
|
Issue also referenced in discussion - Error message "fatal: cannot force update the branch 'master' checked out at '/opt/homebrew'" when installing Homebrew #5113 |
This other thread also refers to the error only directly after install on Apple Silicon macs, which is where I saw the issue also. It's interesting that you also have seen it in a case not right after install-- maybe there are multiple ways to hit the state with the fatal error. Perhaps it'd be helpful if someone doing a fresh install of homebrew on Apple Silicon ran their first |
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Perform an initial brew update after .pkg installation on Apple Silicon without seeing a fatal error in the output
What happened (include all command output)?
Used GUI .pkg installer of latest homebrew from Releases -> Assets
Ran brew update:
What did you expect to happen?
Not see any fatal errors on first invocation of brew update
Step-by-step reproduction instructions (by running
brew
commands)Observe:
Note that brew update DOES fix the problem and subsequent brew updates do not have this fatal error.
However, it seems unacceptable that a clean install of brew via the .pkg should reproducibly produce a fatal error when clean installed. This is an ugly look for what should be considered a first class package manager. There is no way to submit an issue to homebrew-core with issues that only occur on the first brew update, but we should not require users to have to ignore errors marked fatal.
I think EITHER there should be code in brew update to handle whatever was handled without showing a fatal error OR the pkg installer should not install the state that brew update generates a fatal error. (I'm not sure which.)
I did not run these commands before running brew update, but perhaps it's useful or interesting that after the first brew update after install prints:
Then I see a different branch here:
The text was updated successfully, but these errors were encountered: