I am unable to install tree command using 'brew install tree'. I am getting the following output:
>Updating Homebrew...
>fatal: Could not resolve HEAD to a revision
>Warning: No available formula or cask with the name "tree".
>==> Searching for similarly named formulae...
>Error: No similarly named formulae found.
>==> Searching for a previously deleted formula (in the last month)...
>Error: No previously deleted formula found.
>==> Searching taps on GitHub...
>Error: No formulae found in taps.
Note that i am using macOS Big Sur version 11.5.2
I had the same issue when first trying to use brew on M1.
Run brew doctor
and if brew was not installed correctly you will see the message below. Running the first two commands "tapped the homebrew" correctly for me. Good luck!
Warning: Homebrew/homebrew-core was not tapped properly! Run:
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
Warning: Some taps are not on the default git origin branch and may not receive updates. If this is a surprise to you, check out the default branch with:
git -C $(brew --repo homebrew/core) checkout master