Lesson

Git Install

10 min reading
Free Course

Git Install: Setting Up Git on Windows, macOS, and Linux

Installing Git gives you the git command-line tool locally so you can initialize repositories, create commits, and connect to remote hosts like GitHub. Most operating systems install Git in under two minutes using an official installer or package manager.

Installing Git on Windows

Download the official installer from git-scm.com/download/win. Run the setup wizard and keep the default options unless your team specifies otherwise.

The installer includes Git Bash, a Unix-style terminal emulator for Windows that lets you run standard commands like ls, cd, and ssh-keygen smoothly. Make sure the option to add Git to your system PATH is selected so PowerShell and VS Code terminals recognize git.

Installing Git on macOS

Open the Terminal app and run git --version. If Git is not installed yet, macOS prompts you to install the Xcode Command Line Tools.

For newer releases or easier upgrades, install Git with Homebrew instead:

brew install git
git --version

Installing Git on Linux

Use your distribution's package manager to install the latest stable package:

sudo apt update && sudo apt install -y git   # Ubuntu / Debian
sudo dnf install -y git                      # Fedora / RHEL

Verifying Your Installation and Line Endings

Once installation finishes, open a fresh terminal window and verify the installed version:

git --version

You should see output such as git version 2.47.0. Next, configure line-ending handling so Windows (CRLF) and macOS/Linux (LF) teammates do not create noisy whitespace diffs in files like styles.css or index.html:

git config --global core.autocrlf true    # Windows
git config --global core.autocrlf input   # macOS / Linux

Common Installation Issues

If your terminal prints git: command not found right after installing on Windows, close and reopen your terminal so it reloads the updated PATH environment variable.

On corporate machines without administrator rights, use the portable Git archive on Windows or install Git inside Windows Subsystem for Linux (WSL) where you manage your own user packages.

Frequently Asked Questions

Should I use Git Bash or PowerShell on Windows?

Both work well once Git is on your PATH. Git Bash is helpful if you follow Linux-style tutorials, while PowerShell and Windows Terminal integrate cleanly with modern Windows developer setups.

How do I update an existing Git installation?

On Windows, run git update-git-for-windows in Git Bash or download the newest installer. On macOS run brew upgrade git, and on Linux use sudo apt update && sudo apt upgrade git.

Do I need a separate GUI app after installing Git?

No. The command-line installation includes everything required for version control, plus built-in tools like gitk and git gui. Visual Studio Code also detects your installed git binary automatically.

Save Your Progress

Unlock Your
Full Potential.

Sign in to track your learning journey, earn industry-recognized certificates, and join our elite developer community.

Quick Access With

Enterprise-Grade Security Protocol
Git Topic Hub

Stuck on this lesson?

Join our community of senior developers.

Ask in Forum