homebrew下载速度真是太慢了,切换到清华的
https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
git clone https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/install.git
cd install
并编辑其中的 install.sh:
BREW_REPO="https://github.com/Homebrew/brew"
改成:
BREW_REPO="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
下面的两个包官方下载速度非常慢,用中国的镜像快很多
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
git clone git://mirrors.ustc.edu.cn/homebrew-cask.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
运行
./install.sh
最后
brew update
下面的不用看,纯记录
另一个git浅拷贝的方法记在这里
进行两个仓库的shallow clone
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
git clone git://mirrors.ustc.edu.cn/homebrew-cask.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask --depth=1
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow