1. 替换brew.git 仓库地址:

    cd "$(brew --repo)"
    git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

还原

cd "$(brew --repo)"
git remote set-url origin https://github.com/Homebrew/brew.git
  1. 替换homebrew-core.git 仓库地址:

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

还原

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