What is Git?

Git is a distributed version control system that tracks changes in your code. It’s essential for collaborating with others and deploying your projects.

Installation

macOS

Git comes pre-installed on most Macs. Open Terminal and check:

git --version

If not installed, you’ll be prompted to install Xcode Command Line Tools. Alternatively:

# Using Homebrew
brew install git

Windows

  1. Download the installer from git-scm.com
  2. Run the installer — the default settings are fine for most users
  3. Make sure “Git from the command line and also from 3rd-party software” is selected
  4. Open a new terminal and verify:
git --version

Linux

# Debian/Ubuntu
sudo apt update && sudo apt install git
 
# Fedora
sudo dnf install git
 
# Arch
sudo pacman -S git

Initial Configuration

After installing, set your identity:

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Verify

git --version
git config --list

You should see your name and email in the output.