Git Installation & Setup - Windows, macOS, Linux (2026 Guide)

Step-by-step guide to install Git on Windows, macOS, and Linux! Plus Git configuration, VS Code integration, and first-time setup!

Introduction

Let's install Git and set it up! This guide covers Windows, macOS, and Linux!

What You Will Learn

  • Installing Git on Windows, macOS, Linux
  • Git configuration: name, email, default branch
  • VS Code as your Git editor
  • Verifying your installation

Prerequisites

Step 1: Installing Git

Windows

  1. Go to git-scm.com/download/win
  2. Download the latest Git for Windows installer
  3. Run the installer!
  4. Use the default options - they're good!
  5. When asked "Choosing the default editor", select "Visual Studio Code" (if installed!)

macOS

Option A: Use Homebrew (RECOMMENDED!)

brew install git

Option B: Install from git-scm.com

  1. git-scm.com/download/mac
  2. Download and install!

Linux (Debian/Ubuntu)

sudo apt update
sudo apt install git

Linux (Fedora/RHEL)

sudo dnf install git

Step 2: Verify the Installation

Open a terminal (Git Bash on Windows, Terminal on macOS/Linux) and run:

git --version

You should see something like:

git version 2.47.0

Great! Git is installed!

Step 3: Configuring Git (IMPORTANT!)

Every Git commit has an author! Let's set yours!

# Set your name (IMPORTANT: Use your real name!)
git config --global user.name "Your Full Name"

# Set your email (IMPORTANT: Use the email associated with GitHub!)
git config --global user.email "you@example.com"

Set Default Branch Name

GitHub uses main now, not master!

git config --global init.defaultBranch main

Set Default Editor (VS Code)

Let's use VS Code for editing commits:

git config --global core.editor "code --wait"

Step 4: Check Your Configuration

Let's verify:

git config --list

You should see your name, email, default branch, and editor!

Step 5: Optional: Git GUI Clients

You don't need a GUI, but they can help! Popular options:

  • GitHub Desktop: Good for beginners
  • GitKraken: Beautiful, powerful
  • SourceTree: Good for teams
  • VS Code: Built-in Git integration (great!)

Step 6: VS Code Integration (RECOMMENDED!)

VS Code has excellent Git integration built-in! You don't need to install anything extra!

VS Code lets you:

  • See changed files
  • Stage and commit
  • View diffs
  • Push/pull
  • And much more!

Common Installation Issues

Git not found in terminal (Windows)

Make sure Git Bash is in your PATH, or use Git Bash!

Permission issues (macOS/Linux)

Use sudo if needed!

First-Time Setup: Summary

  1. Install Git!
  2. Configure user.name and user.email!
  3. Set default branch to main!
  4. (Optional) Set up VS Code as editor!

Best Practices

  1. Use the same email for Git and GitHub: Makes commits count towards your GitHub contributions!
  2. Use your real name: Professional for work/OSS!
  3. Configure on every machine: Set up Git on every computer you use!
  4. Learn CLI first: GUIs are fine, but know the commands!

Summary

Git is installed and configured! You're ready to start using Git!

Related Articles

Previous Tutorial

Why Git

Next Tutorial

Let's learn Git basics! → Git Basics: Your First Commits