# 手动设置 export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git" brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git brew tap --custom-remote --force-auto-update homebrew/cask-fonts https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git brew tap --custom-remote --force-auto-update homebrew/cask-drivers https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git brew update
# 或使用下面的几行命令自动设置 export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git" for tap in core cask{,-fonts,-drivers,-versions} command-not-found; do brew tap --custom-remote --force-auto-update "homebrew/${tap}""https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-${tap}.git" done brew update
# 以下针对 macOS 系统上的 Homebrew unset HOMEBREW_CORE_GIT_REMOTE BREW_TAPS="$(BREW_TAPS="$(brew tap 2>/dev/null)"; echo -n "${BREW_TAPS//$'\n'/:}")" for tap in core cask{,-fonts,-drivers,-versions} command-not-found; do if [[ ":${BREW_TAPS}:" == *":homebrew/${tap}:"* ]]; then# 只复原已安装的 Tap brew tap --custom-remote "homebrew/${tap}""https://github.com/Homebrew/homebrew-${tap}" fi done