Self-paced

Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.

Bootcamp

Learn live

Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.

Upcoming live events

Learning library

For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Search from all Lessons


LoginGet Started
← Back to How to's
  • git

  • github

  • windows

  • macos

  • linux

Edit on Github

Install Git On Windows Macos And Linux - Comprehensive Guide

Written by:

How to Install Git on Windows, macOS, and Linux: A Comprehensive Guide

Git is an essential tool for version control, widely used in the software development industry. Installing Git on your computer allows you to manage your code efficiently, collaborate with others, and maintain a history of your projects.

💡 This article is about installing git, not using git, click here if you are looking for a comprehensive guide on how to use git or how to clone a github repository.

This article provides a step-by-step guide to installing Git on Windows, macOS, and Linux.

Installing Git on Windows

Download the Installer

  • Visit the official Git website: Git for Windows.
  • Click on the "Download" button to get the latest version.

Run the Installer

  • Locate the downloaded .exe file and double-click to run it.
  • Follow the installation prompts. The default settings are generally suitable for most users.

Configure Git

  • Open Command Prompt or PowerShell.
  • Set your username and email address:
1git config --global user.name "Your Name" 2git config --global user.email "your.email@example.com"

Installing Git on macOS

Using Homebrew

  • If you don't have Homebrew installed, open Terminal and install it:
    1/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • Install Git using Homebrew:
    1brew install git

Manual Installation

  • Download the latest Git installer for macOS from the official Git website: Git for macOS.
  • Open the downloaded .dmg file and follow the installation instructions.

Configure Git

  • Open Terminal.
  • Set your username and email address:
    1git config --global user.name "Your Name" 2git config --global user.email "your.email@example.com"

Installing Git on Linux (Debian/Ubuntu-Based Distributions)

Update the Package List

  • Open Terminal and run:
    1sudo apt update

Install Git

  • Run the following command:
    1sudo apt install git

Installing Git on Linux (Fedora-Based Distributions)

Install Git

  • Open Terminal and run:
    1sudo dnf install git

Installing Git on Linux (CentOS/RHEL-Based Distributions)

Enable the EPEL Repository

  • Open Terminal and run:
    1sudo yum install epel-release

Install Git

  • Run the following command:
    1sudo yum install git

Configure Git

  • Open Terminal.
  • Set your username and email address:
    1git config --global user.name "Your Name" 2git config --global user.email "your.email@example.com"

Verifying the GIT Installation

After installing Git, verify that it is installed correctly by running the following command in your terminal or command prompt:

1git --version

You should see the installed Git version number.

Git vs Github

Git and GitHub are very different things: The first one is a free and open-source technology to track your project changes, and the second one is a for-profit company that uses Git (like many other companies like Gitlab and Bitbucket). Nevertheless, we strongly recommend you understand what is Github and how to build your coding reputation on it because it will help you a lot throughout your career.

Conclusion

By following these steps, you should have Git installed on your computer, regardless of the operating system. Configuring your Git user information ensures that your commits are attributed to you correctly. With Git set up, you can start managing your projects more efficiently and collaborate with others seamlessly.