替换国内源
查看 brew.git
当前源
cd "$(brew --repo)" && git remote -v
查看homebrew-core.git
当前源
cd "$(brew --repo homebrew/core)" && git remote -v
修改brew.git
为阿里源
git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
修改homebrew-core.git
为阿里源
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
zsh 替换brew bintray
镜像
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
刷新源
brew update
Macos升级后brew异常问题
解决方式
cd /usr/local/Homebrew/
git pull