零、Homebrew 镜像地址(推荐中科大镜像)
1、brew.git 镜像
中科大镜像:https://mirrors.ustc.edu.cn/brew.git
清华镜像:https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
GitHub镜像:https://github.com/Homebrew/brew.git
2、homebrew-core.git 镜像
中科大镜像:https://mirrors.ustc.edu.cn/homebrew-core.git
清华镜像:https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
GitHub镜像:https://github.com/Homebrew/homebrew-core
一、替换 Homebrew 镜像源
1、替换 brew.git
以中科大镜像为例
$ cd "$(brew --repo)"
$ git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
或
$ git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
2、替换 homebrew-core.git
以中科大镜像为例
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
或
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
二、重置 Homebrew 镜像源
切回官方原始镜像(GitHub)
$ 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