Installing Git – Step-by-Step Guide

Why Install Git?

Git is an essential tool for developers, enabling version control and collaboration on coding projects. Before you can start using Git, you need to install it on your system.

This guide will walk you through the installation process for Windows, Mac, and Linux step by step.


Downloading Git

The official Git website provides the latest versions for all platforms: Download Git


️ Installing Git on Windows

1️⃣ Download Git for Windows from the official Git website.
2️⃣ Run the installer and follow the on-screen instructions.
3️⃣ Choose default settings, unless you have specific preferences.

  • Select "Git from the command line and also from 3rd-party software."
  • Use the recommended default editor (Vim, Notepad++, or Visual Studio Code).
  • Keep the default branch name as main (recommended for new projects).
  • Choose "Use bundled OpenSSH" and "Use the native Windows Secure Channel Library."
  • Enable "Git Credential Manager."

4️⃣ Finish the installation and restart your computer if necessary.

To verify installation, open Command Prompt or Git Bash and type:

git --version

If Git is installed correctly, you should see the version number.


Installing Git on macOS

1️⃣ Open Terminal (Applications → Utilities → Terminal).
2️⃣ Check if Git is already installed:

git --version

3️⃣ If Git is not installed, install it using Homebrew:

brew install git

(If you don’t have Homebrew installed, follow the instructions at brew.sh)

4️⃣ Verify the installation:

git --version

Git is now ready to use on macOS!


Installing Git on Linux

For Debian/Ubuntu-based distributions:

sudo apt update
sudo apt install git -y

For Fedora-based distributions:

sudo dnf install git -y

For Arch Linux:

sudo pacman -S git

Verify Installation:

git --version

Git is now installed on Linux!


Configuring Git (After Installation)

Once Git is installed, configure your name and email (required for commits):

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Verify your settings:

git config --list

Next Steps

Now that Git is installed, it's time to start using it!

Basic Git Commands – Learn essential Git operations.
Working with Repositories – Create and manage Git projects.

Need help? Feel free to ask in the comments or check the official Git Documentation.