Skip to content

How to install Git on macOS

In this post I’ll walk you through the process of installing Git on macOS. It’s a straightforward process that will have you up and running with version control in no time.

There are two main methods to install Git on macOS: using Homebrew or downloading the installer from the official Git website. We’ll cover both approaches.

Let’s start with Homebrew. It’s a popular package manager for macOS. If you don’t have Homebrew installed, you can install it by running this command in your Terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Once Homebrew is installed, you can easily install Git by running:

brew install git

If you prefer using the official installer, here’s what you need to do: First, visit the official Git website at https://git-scm.com/download/mac. Download the latest version for macOS, open the downloaded .dmg file, and run the installer, following the prompts.

After installation, it’s important to verify that Git was installed correctly. Open a new Terminal window and run:

git --version

This should display the installed Git version, confirming a successful installation.

Now, let’s set up your Git identity. Run these commands, replacing the placeholder information with your own:

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

To keep Git up to date, you can use Homebrew (if that’s how you installed it) by running:

brew upgrade git

If you used the installer, you’ll need to download and run the latest version from the Git website when updates are available.

That’s it! You now have Git installed and configured on your macOS system.

Want to actually learn Git? Want to stop feeling frustrated with it? I created the Git Masterclass to solve this problem!


→ Want to actually learn Git? Want to stop feeling frustrated with it? I created the Git Masterclass to solve this problem!

download all my books for free

  • javascript handbook
  • typescript handbook
  • css handbook
  • node.js handbook
  • astro handbook
  • html handbook
  • next.js pages router handbook
  • alpine.js handbook
  • htmx handbook
  • react handbook
  • sql handbook
  • git cheat sheet
  • laravel handbook
  • express handbook
  • swift handbook
  • go handbook
  • php handbook
  • python handbook
  • cli handbook
  • c handbook

subscribe to my newsletter to get them

Terms: by subscribing to the newsletter you agree the following terms and conditions and privacy policy. The aim of the newsletter is to keep you up to date about new tutorials, new book releases or courses organized by Flavio. If you wish to unsubscribe from the newsletter, you can click the unsubscribe link that's present at the bottom of each email, anytime. I will not communicate/spread/publish or otherwise give away your address. Your email address is the only personal information collected, and it's only collected for the primary purpose of keeping you informed through the newsletter. It's stored in a secure server based in the EU. You can contact Flavio by emailing [email protected]. These terms and conditions are governed by the laws in force in Italy and you unconditionally submit to the jurisdiction of the courts of Italy.

Related posts about git: