目录

brew update时报错“fatal_ Could not resolve HEAD to a revision”解决

报错信息

在安装brew并更改为国内下载源后,执行brew update时老是报错,信息如下: https://raw.githubusercontent.com/AlexWuYh/Pic-Host/master/photo/image%20(4).png

解决办法

上网查了下,找到了解决办法,参考链接 依次执行下面的命令/步骤:

1
brew update --verbose

https://raw.githubusercontent.com/AlexWuYh/Pic-Host/master/photo/image%20(5).png

依次进入执行后报错的目录中去,再分别执行命令:

1
2
3
git fetch --prune origin

git pull --rebase origin master

https://raw.githubusercontent.com/AlexWuYh/Pic-Host/master/photo/image%20(6).png 最后再次执行brew update就可以正常更新源了 https://raw.githubusercontent.com/AlexWuYh/Pic-Host/master/photo/image%20(7).png