无法使用 brew 安装树

Not able to install tree using brew

我无法使用 'brew install tree' 安装树命令。我得到以下输出:

>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.

请注意,我使用的是 macOS Big Sur 版本 11.5.2

我第一次尝试在 M1 上使用 brew 时遇到了同样的问题。

运行 brew doctor 如果未正确安装 brew,您将看到以下消息。 运行前两个命令为我正确地“点击了自制程序”。祝你好运!

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