No available formula or cask with the name "git"
使用 brew config
檢查brew的配置項(xiàng)
我的配置項(xiàng)中core tap有配置項(xiàng)缺失,所以brew無法找到包
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: (none)
Core tap last commit: never
Core tap branch: HEAD
20210506131629.jpg
執(zhí)行以下命令藕筋,刪除原有的homebrew-core文件夾秧饮,重新創(chuàng)建
rm -rf /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
brew tap homebrew/core
修復(fù)core tap的配置項(xiàng)后:
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 78dbff03e5f3a0c9f4a341788e563f060064540e
Core tap last commit: 4 minutes ago
Core tap branch: master
20210506131403.jpg
此時(shí)重新 brew install git
成功啦 ????
出自里邊有位叫 carlocab 的同學(xué)的解答 https://github.com/Homebrew/discussions/discussions/580
一開始還遇到有mac使用brew的權(quán)限問題墓毒,根據(jù)命令行的提示用sudo給予一定的配置后就可以使用brew了