Git
gitgitGuideBeginner
Installing Git on macOS, Linux, and Windows
Step-by-step installation instructions for Git across macOS (Homebrew/Xcode), Ubuntu/Debian, Fedora, and Windows (Git for Windows).
Verified: 2026-09-30
Platforms:
macoslinuxwindows
#git#installation#cli#setup
Installing Git on macOS, Linux, and Windows
1. macOS Installation
Option A: Homebrew (Recommended)
brew install gitOption B: Apple Xcode Command Line Tools
xcode-select --install2. Linux Installation
Ubuntu / Debian:
sudo apt update
sudo apt install -y gitFedora / RHEL:
sudo dnf install -y gitArch Linux:
sudo pacman -S git3. Windows Installation
Download and run the official installer from git-scm.com/download/win to install Git for Windows, which includes:
- Git Bash (Unix terminal emulation)
- Git GUI
- Windows Credential Manager integration
4. Verifying Installation
Verify that the CLI executable is available in your $PATH:
git --version
# Expected: git version 2.45+ or newerRelated Topics
Introduction to Git Version Control
Understanding Git: distributed version control vs centralized systems, snapshots vs deltas, and the three-tree architecture.
Git Configuration (git config)
Setting up user name, email, default branch (main), core editor, credential helper, and global vs local configuration scopes.