Installing Git
Git is available for all major operating systems — Windows, macOS, and Linux. The installation process is straightforward on each platform. After installation, Git is used through a terminal (command line), though graphical tools are also available.
Checking if Git is Already Installed
Before downloading Git, check whether it is already installed on the system. Open a terminal or command prompt and type:
git --versionIf Git is installed, something like this will appear:
git version 2.43.0If the command is not found, Git needs to be installed.
Installing Git on Windows
Step 1 — Download the Installer
Visit the official Git website: https://git-scm.com/download/win
The download will start automatically for the correct Windows version (32-bit or 64-bit).
Step 2 — Run the Installer
Open the downloaded .exe file and follow the installation wizard. Most default options are perfectly fine for beginners. Some key options during installation:
- Select Components — Keep all defaults selected
- Default Editor — Choose a preferred text editor (e.g., Visual Studio Code or Notepad++)
- Adjusting PATH environment — Select "Git from the command line and also from 3rd-party software"
- Line Ending Conversions — Keep the default "Checkout Windows-style, commit Unix-style line endings"
Step 3 — Verify Installation
Open Git Bash (installed with Git on Windows) or Command Prompt and type:
git --versionA version number confirms successful installation.
Installing Git on macOS
Option 1 — Using Xcode Command Line Tools (Easiest)
Open Terminal and type:
git --versionIf Git is not installed, macOS will automatically prompt to install the Xcode Command Line Tools, which includes Git. Click "Install" and wait for it to complete.
Option 2 — Using Homebrew (Recommended for Developers)
If Homebrew is already installed, run:
brew install gitTo install Homebrew first, visit https://brew.sh and follow their one-line install command.
Option 3 — Download Directly
Visit https://git-scm.com/download/mac and download the macOS installer.
Verify Installation on macOS
git --versionInstalling Git on Linux
Ubuntu / Debian
sudo apt update
sudo apt install gitFedora / CentOS / RHEL
sudo dnf install gitArch Linux
sudo pacman -S gitVerify Installation on Linux
git --versionWhat is Git Bash?
Git Bash is a terminal application that comes with the Git installation on Windows. It provides a Unix-like command-line environment on Windows, meaning all standard Git and Linux commands work inside it. It is the recommended way to use Git on Windows.
Graphical Interfaces for Git (Optional)
While Git is used through the command line, there are graphical tools available for those who prefer a visual interface:
| Tool | Platform | Description |
|---|---|---|
| GitHub Desktop | Windows, macOS | Official GitHub GUI client |
| Sourcetree | Windows, macOS | Free visual Git client by Atlassian |
| GitKraken | Windows, macOS, Linux | Feature-rich Git GUI tool |
| VS Code | All platforms | Built-in Git support in the editor |
Note: Learning Git through the command line is highly recommended. It builds a deeper understanding and works across all tools and environments.
Summary
Git can be installed on Windows, macOS, and Linux with just a few steps. After installation, verify it by running git --version in the terminal. On Windows, Git Bash is the recommended terminal for running Git commands.
