git clone http://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
git clone http://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
mdkir /usr/local/Cellar
brew -v
此时你安装时超时更换国内镜像源 替换homebrew默认源
cd "$(brew --repo)"
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
bash用户:
echo 'export HOMEBREW_BOTTLE_DOMAIN=http://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile #刷新
zsh用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=http://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc #刷新
brew update