mac修改brew源
参考:https://juejin.im/post/5daec26a51882575d50cd0aa
1.查看brew当前源
git -C "$(brew --repo)" remote -v origin https://github.com/Homebrew/brew (fetch) origin https://github.com/Homebrew/brew (push)
2.改成清华的源
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
已经修改成清华的源
git -C "$(brew --repo)" remote -v origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git (fetch) origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git (push)
或者改成中科大的源
# 替换 Homebrew git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git # 替换 Homebrew Core git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git # 替换 Homebrew Cask git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git # 更新 brew update
如果想还原
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git brew update
本文只发表于博客园和tonglin0325的博客,作者:tonglin0325,转载请注明原文链接:https://www.cnblogs.com/tonglin0325/p/12314093.html