brew install 報錯`fatal: Could not resolve HEAD to a revision`


想安裝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

然后安裝成功,問題解決

參考連接


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM