简介
环境信息
MacOS 10.15.6
homebrew 2.5.1
正文
1、设置 git remote
设置 homebrew core,下面命令将设置 homebrew core 的 REPO 地址为清华源
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
设置 homebrew cask,下面命令将设置 homebrew core 的 REPO 地址为清华源
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
设置 homebrew cask-fonts,下面命令将设置 homebrew cask-fonts 的 REPO 地址为清华源
git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
设置 homebrew cask-drivers,下面命令将设置 homebrew cask-drivers 的 REPO 地址为清华源
git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git
注:上面的命令不需要全部执行,请根据你的需要设置即可。比如,你只用到了 homebrew 的基本命令,并没有用到 brew cask 相关的功能。那么后面的三项设置均可以不用设置。
3、更新 brew
brew update
总结
1、执行如下命令进行校验
git -C "$(brew --repo homebrew/core)" remote get-url origin
jiangzhuolin@bogon ~ % git -C "$(brew --repo homebrew/core)" remote get-url origin
https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
其他几项也是类似的方法,略过。
附录
列举附录及参考信息
https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/