1. # 替换brew.git:
    2. $ cd "$(brew --repo)"
    3. # 中国科大:
    4. $ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
    5. # 替换homebrew-core.git:
    6. $ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    7. # 中国科大:
    8. $ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
    9. # 替换homebrew-bottles:
    10. # 中国科大:
    11. # $ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
    12. # $ source ~/.bash_profile
    13. $ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
    14. $ source ~/.zshrc
    15. # 应用生效:
    16. $ brew update
    17. # 重置brew.git:
    18. $ cd "$(brew --repo)"
    19. $ git remote set-url origin https://github.com/Homebrew/brew.git
    20. # 重置homebrew-core.git:
    21. $ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    22. $ git remote set-url origin https://github.com/Homebrew/homebrew-core.git