How to install Git on macOS
New Courses Coming Soon
Join the waiting lists
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.
Check out my Git Cheat Sheet on freeCodeCamp, and download the PDF version from https://flaviocopes.com/access
Here is how can I help you:
- COURSES where I teach everything I know
- CODING BOOTCAMP cohort course - next edition in 2025
- THE VALLEY OF CODE your web development manual
- BOOKS 17 coding ebooks you can download for free on JS Python C PHP and lots more
- Interesting links collection
- Follow me on X