Mac修改brew國內源以加快下載速度

簡介

因爲Homebrew默認的源是GitHub源,在國內因爲你懂的原因,下載速度堪憂,顧考慮更換國內源,幸好中科大和清華都提供了brew源,因此我們考慮更換爲這兩個學校的brew源

替換現有上游

cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

brew update

復原

cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://github.com/Homebrew/homebrew-core

brew update

轉:https://www.jianshu.com/p/c6ecbce5464f
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章