Git is the most popular version control system used by developers to track changes, collaborate, and manage source code. Whether you’re working on solo projects or collaborating through GitHub or GitLab, you’ll need Git installed on your machine to get started.
In this guide, weβll walk you through how to download and install Git on Windows, macOS, and Linux.
π₯ Step 1: Download Git
Visit the official Git website:
π https://git-scm.com/downloads
The page automatically detects your operating system and provides the correct download link.
π₯οΈ Installing Git on Windows
β Steps:
- Go to https://git-scm.com/download/win
- The installer (
.exe
file) will start downloading automatically. - Once downloaded, open the file to launch the setup wizard.
- Follow the installation prompts:
- Select the default editor (e.g., Vim or Notepad++)
- Choose default branch name (usually
main
) - Leave other settings as default unless you know what youβre customizing
- Click Finish when complete.
β Verify Installation
Open Command Prompt and type:
git --version
You should see the installed Git version, e.g., git version 2.44.0.windows.1
π Installing Git on macOS
Option 1: Install via Homebrew (Recommended)
If you have Homebrew installed:
brew install git
Option 2: Download Installer
- Visit https://git-scm.com/download/mac
- Download the
.dmg
file and run the installer - Follow the on-screen steps
Verify Installation
Open Terminal and run:
git --version
π§ Installing Git on Linux (Ubuntu/Debian)
Open your terminal and run:
sudo apt update
sudo apt install git
For Fedora:
sudo dnf install git
For Arch:
sudo pacman -S git
Verify Installation
git --version
π§ Post-Installation: Configure Git
Once Git is installed, set your name and email (used in your commits):
git config --global user.name "Your Name"
git config --global user.email "yo*@ex*****.com"
Optional: Set default editor
git config --global core.editor "code --wait" # For VS Code
β Summary
OS | Installation Method | Command/Link |
---|---|---|
Windows | Installer (.exe) | git-scm.com |
macOS | Homebrew or Installer | brew install git or use .dmg file |
Linux | Package Manager (apt, dnf, pacman) | sudo apt install git |
π Conclusion
Installing Git is a one-time setup that unlocks powerful collaboration and version control capabilities. Once installed, youβre ready to start cloning repositories, committing changes, and contributing to projects like a pro.