As as a frequent user of Homebrew on macOS, I find myself using the same few commands over and over. For that reason, I've listed those commands with a short explanation of each, so others don't need to trawl the web or read the man pages.
Once you've got Homebrew installed, you can update Homebrew itself with the command:
$ brew update
$ brew install git
Outside of the standard Homebrew list of formulae, you can access other repositories of formulae for other functions. An example of this would be the Homebrew PHP "tap" which can be installed by accessing three taps:
# https://github.com/Homebrew/homebrew-php#installation $ brew tap homebrew/dupes $ brew tap homebrew/versions $ brew tap homebrew/homebrew-php
You will now be able to access a lot of new PHP formulae.
# Show the individual packages installed $ brew list # returns: autoconf node rbenv yarn gdbm openssl readline z git pcre ruby-build zsh hugo pkg-config sqlite zsh-completions icu4c python trash zsh-syntax-highlighting # Show each of the full formulae installed $ brew leaves # returns: git hugo python rbenv trash yarn z zsh zsh-completions zsh-syntax-highlighting
$ brew outdated # If nothing is returned to the terminal, you're up-to-date.
# Update a specific formula (e.g. Git) $ brew upgrade git # Upgrade all formula $ brew upgrade
$ brew uninstall git
$ brew remove --force --ignore-dependencies $(brew list)
# List forumlas that can be cleaned up $ brew cleanup -n # Remove all old formulae $ brew cleanup # Remove old symlinks $ brew prune
Homebrew has a built-in doctor which will let you know if everything is working correctly. If not, it will output an error message that you can hopefully use to diagnose the issue.
$ brew doctor
The alternative to remembering all of these commands is using a GUI. For those who want a GUI, Cakebrew seems to be the best option.