本來 brew 用的好好的,今天安裝java時由於本沒電了,電腦自動關機, 再次啓動重新安裝時出現以下錯誤
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
搞得很煩。
1. 將usr/local/Homebrew目錄下所有文件刪掉。
2. 把github 上 brew clone 下來
git clone https://github.com/Homebrew/brew.git
3. 把clone 下來的 brew 文件夾下所有的文件放到Homebrew下面。
嘗試下載java , 終於不再報上述錯誤, 整個人都變好了。