Homebrew Cheatsheet

Update

brew update
brew doctor

Install a package

brew install git

Remove/Uninstall a package

brew uninstall git

Upgrade a package

brew upgrade git

Unlink current package

brew unlink git

Link a package

brew link git
brew link --overwrite --force git

Change Version

brew switch git 2.5.0

List all versions

brew list --versions git

Clean up

brew cleanup

Install PHP

brew install shivammathur/php/php@5.6
brew install shivammathur/php/php@7.0
brew install shivammathur/php/php@7.1
brew install shivammathur/php/php@7.2
brew install shivammathur/php/php@7.3
brew install shivammathur/php/php@7.4
brew install shivammathur/php/php@8.0
brew install shivammathur/php/php@8.1