How to download and install Git on Mac

Git is the free version control system most developers use, and on a Mac it comes with Apple’s Command Line Tools or from Homebrew: git-scm.com, Git’s official site, lists both. Here is how to install it either way, check that it works and set it up for your first commit.

Git

  • Comes with Apple’s Command Line Tools
  • Apple Silicon and Intel
  • Free, open source

The links go to the developer’s website (git-scm.com). MacWashing is not affiliated with the developer and keeps no installers.

Open Terminal (Applications › Utilities) and run:

brew install git

Homebrew downloads the app from the developer’s server, checks the file and puts the app in Applications.

No Homebrew yet? How to install Homebrew: one command from brew.sh.

Which way to choose

Git has no Mac installer of its own. Both ways below are free and work on Apple Silicon and Intel Macs:

  • Command Line Tools for Xcode. Apple’s package of developer tools, Git included. The easiest way: Git is updated with macOS software updates, usually a little behind the newest release.
  • Homebrew. Gives you the newest Git and updates it with brew upgrade. You need Homebrew first: see how to install Homebrew.

You don’t need the full Xcode app for Git: the Command Line Tools are a much smaller download. The old standalone Git installers for Mac stopped at version 2.33 and are no longer updated.

How to install Git with the Command Line Tools

  1. Open Terminal: Applications › Utilities › Terminal, or press Command-Space and type Terminal.
  2. Run the command below. Typing just git without the tools installed offers the same install.
  3. In the dialog that opens, click Install, then Agree to the license.
  4. Wait for the download and installation to finish, then click Done.
xcode-select --install

Check that Git works:

git --version

What to set up after installing

  • Your name and email. Git writes them into every commit. Set them once with the two commands below, using your own name and the email of your Git hosting account.
  • Updates. Git from the Command Line Tools updates in System Settings › General › Software Update. Git from Homebrew with brew upgrade git.
  • Which Git runs. After installing with Homebrew, open a new Terminal window: git --version should no longer mention Apple Git.
  • Signing in to GitHub. GitHub doesn’t accept your account password for Git over HTTPS. Use a personal access token or an SSH key, as GitHub’s help describes.
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

If Git won’t install or run

  • «Can’t install the software because it is not currently available from the Software Update server». Download Command Line Tools for Xcode for your macOS from Apple’s developer site, developer.apple.com/download/all (sign in with your Apple Account), and install it from the .dmg.
  • «xcrun: error: invalid active developer path» after a macOS update. The update removed the tools. Run xcode-select --install again.
  • «Command line tools are already installed». Git is already there: check with git --version. Updates come through Software Update.

Alternatives to Git

Keep your Mac tidy

MacWashing, System Junk: Xcode junk, user caches, installers and logs found, 22.83 GB ready to be cleaned

Developer tools leave caches, logs and old builds behind. System Junk in MacWashing finds the caches apps and developer tools build up and shows how much space they take.

Free trial · macOS 14 or later

Questions and answers

Is Git free?

Yes. Git is free and open source. Services built around it, like GitHub or GitLab, have free and paid plans of their own.

Do I need Xcode to use Git?

No. The Command Line Tools are enough, and they are a much smaller download than Xcode. If Xcode is installed, Git comes with it too.

Is there a Git app with windows and buttons?

Git itself works in Terminal. git-scm.com lists graphical apps for it, and Homebrew installs Git’s own simple tools with brew install git-gui.