[TOC] ## 设置镜像 ### zsh ``` //替换brew.git: cd "$(brew --repo)" git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git //替换homebrew-core.git: cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git //应用生效 brew update //替换homebrew-bottles: echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc source ~/.zshrc ``` ## 命令 ``` brew search git 搜索 brew install git 安装 brew uninstall git 卸载 brew upgrade git 升级 brew info git 查看信息 brew cleanup git 清楚老版本 brew unlink git Unlink brew link git Link brew list --versions git 查看版本 brew switch git 2.5.0 切换版本 //cask brew cask install firefox 安装界面应用 brew cask list 列出安装应用 //global brew outdated 检查老版本 brew upgrade 更新所有应用 brew cleanup 删除应用的旧版本和缓存删除 brew doctor 检查 brew list 列出安装应用 ```