...menustart
...menuend
$ cd $(brew --repo)/Library/Taps/homebrew/homebrew-core/
$ git reset --hard HEAD
- use
brew --cacheto find the cache folder - homebrew use
brew --cache\downloads folder to keep downloaded files- and use
ln -sto make a reference atbrew --cachefolder
- and use
- 目标文件 可以通过如下命令获得
brew --cache [-s] <package_name>( -s means from source , not bottle )
替换现有上游:
git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
brew update恢复官方
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.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
brew updateexport HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles- 先下载 brew install 文件 ( 安装命令的 curl 那一段 ), 保存为
brew_install -
BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git".freeze CORE_TAP_REPO="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git".freeze
ruby brew_install安装- 安装完成后,替换homebrew源
brew update