想安裝tree工具,執行brew install tree
后收到下面報錯
Updating Homebrew...
fatal: Could not resolve HEAD to a revision
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "tree".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
進入到 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
目錄下,發現只有一個git文件
在終端執行下面的指令:
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
git fetch --prune origin
git pull --rebase origin master
然后執行 brew update
完成之后,再執行 brew install tree
然后安裝成功,問題解決