Skip to main content

Installing Git

Git is a version control tool. It lets you save snapshots of your code over time, so you can track changes, undo mistakes, and sync your work with GitHub. Every professional software project uses Git.

Installation

The easiest way to install Git on a Mac is through the Xcode Command Line Tools. Open your Terminal app (search for "Terminal" in Spotlight) and run:

xcode-select --install

A popup will appear asking you to install the command line developer tools. Click Install and wait for it to finish (this may take a few minutes).

Verify the installation

Open your terminal (or Git Bash on Windows) and run:

git --version

You should see something like:

git version 2.44.0

The exact version number doesn't matter, as long as you see a version printed.

Configure Git with your name and email

Git needs to know who you are so it can label your changes. Run these two commands, replacing the placeholders with your actual info:

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

Use the same email you used to create your GitHub account. This is how GitHub connects your local work to your online profile.

Verify the configuration

git config --global user.name
git config --global user.email

Both should print back the values you just set.

What's next?

Git is installed. Next, we'll install Node.js and npm, which are needed to run your application.