What is git?

Git tracks changes in a repository and lets teams review and combine work over time.

Homebrew installs git as a formula: a package definition for command-line software and its dependencies. If Homebrew is not installed yet, follow the official installation guide before continuing.

Install and check the formula

Refresh Homebrew’s package definitions, then install git. Use brew info to inspect the current package and its dependencies; the actual installed version can change over time.

brew update
brew install git
brew info git

Try it

Run the status command inside a Git repository to see the current branch and working-tree changes.

git --version
git status

Before you rely on it

Git does not automatically back up your repositories: configure a remote and push when you want an off-machine copy.

GitHub Desktop is a graphical option for many common Git operations; Git remains useful in scripts and terminals.

Update or remove it

Run brew outdated to see if a newer version is available, and brew upgrade git to upgrade this formula. Before removing it, preview the changes; other packages may depend on it.

brew outdated
brew upgrade git
brew uninstall --dry-run git

Sources and further reading