Upgrade Git on macOS

To start off, you can check which version of git you’re using by typing this in your terminal:

If you use bash (the default shell) edit ~/.bash_profile or if you’ve installed another shell, edit the configuration file for your specific shell. (Ex. For zsh, edit ~/.zshrc.)

In your shell configuration file append the following line:

Restart your terminal and install git via homebrew (a package manager for mac):

You’re done! Try git --version again to see your new git version.

If you ever want to upgrade git in the future, run:

Note: If you don’t have homebrew installed, you can install it with this:




Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store