Recently, when I run brew install with any package, before starting installation Homebrew is always showing the following git-related output.
error: Cannot determine remote HEAD
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
error: Cannot determine remote HEAD
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Remark: just to clarify, yes, it is the same message printed twice.
(but perhaps each message is related to a different repository)
I tried to make some auto fixes running brew doctor and brew cleanup but the above output is still showing up.
What does it mean? Perhaps something got altered after installing some packages?
Do you have any suggestion on how to fix this?
I had similar error on my MacBook Pro M1 due to network problems, this worked for me:
rm -rf /opt/homebrew
Or it might be in another path
rm -rf /etc/homebrew
Check both directories for the homebrew directory and delete it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With