brew换源

105 阅读1分钟

查看 brew.git 当前源

$ cd “$(brew --repo)” && git remote -v
origin github.com/Homebrew/br… (fetch)
origin github.com/Homebrew/br… (push)

查看 homebrew-core.git 当前源

$ cd “$(brew --repo homebrew/core)” && git remote -v
origin github.com/Homebrew/ho… (fetch)
origin github.com/Homebrew/ho… (push)

修改 brew.git 为阿里源

$ git -C “$(brew --repo)” remote set-url origin mirrors.aliyun.com/homebrew/br…

修改 homebrew-core.git 为阿里源

$ git -C “$(brew --repo homebrew/core)” remote set-url origin mirrors.aliyun.com/homebrew/ho…

zsh 替换 brew bintray 镜像

$ echo ‘export HOMEBREW_BOTTLE_DOMAIN=mirrors.aliyun.com/homebrew/ho… >> ~/.zshrc
$ source ~/.zshrc

bash 替换 brew bintray 镜像

$ echo ‘export HOMEBREW_BOTTLE_DOMAIN=mirrors.aliyun.com/homebrew/ho… >> ~/.bash_profile
$ source ~/.bash_profile

刷新源

$ brew update