安装brew: git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1 (注意:如果有/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core目录,可以不执行,也可以,直接把这个目录删掉,再执行) 安装brew cask: git clone git://mirrors.ustc.edu.cn/homebrew-cask.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask --depth=1 (注意:如果有/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask目录,可以不执行,也可以,直接把这个目录删掉,再执行) 替换成国内源: cd "$(brew --repo)" git remote set-url origin https://mirrors.ustc.edu.cn/brew.git cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-cask" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
Let's go!