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
- Mac
- Windows
- Linux
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).
- Go to git-scm.com/downloads/win
- The download should start automatically. If not, click the link for the latest version
- Run the installer
- Use the default settings for every step — just keep clicking Next
- Click Install, then Finish
After installation, you'll have a program called Git Bash. Use Git Bash (not the regular Command Prompt) for all terminal commands in this guide.
Open your terminal and run:
Ubuntu/Debian:
sudo apt update && sudo apt install git
Fedora:
sudo dnf install git
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]"
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.