Alternatively git mirror source and homebrew
A, git accelerate
- Find the address corresponding to the domain name
nslookup github.com
nslookup github.global.ssl.fastly.Net Modify the hosts file
sudo vim /etc/hosts # add two lines at the end. 31.13.66.1 github.global.ssl.fastly.net 13.229.188.59 github.com
Flush the DNS cache (depending on your operating system selection)
# Mac sudo killall -HUP mDNSResponder # linux sudo /etc/init.d/networking restart
Two, homebrew replaced Tsinghua mirroring
Tsinghua mirror sites: Tsinghua mirror sites
homebrew replace Guide: Help Documentation
git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
brew update