Git is one of the most popular open-source, distributed version control systems available, designed to handle everything from small to huge projects with speed and efficiency.

It allows you to keep track of your code changes, create different code branches, collaborate with other developers, to name a few. Linux Kernel, one of the popular open-source projects, is also hosted on a Git repository.

In this article, we’ll cover installing Git on CentOS, Ubuntu, and Windows operating systems.

Git on CentOS 6.x/7.x

To install Git on CentOS release 6.x/7.x or RHEL 6.x/7.x, we’ll use yum package manager. Run the below command to install Git:

If prompted to confirm like below, confirm by pressing ‘y’:

Below is the installation snippet of Git on CentOS 7 minimal setup (please note dependencies installed along with Git may differ on your installation based on your OS version and installed packages):

Git on CentOS 8.x

To install Git on CentOS release 8.x or RHEL 8.x, we’ll use DNF package manager. Run the below command to install Git:

If prompted to confirm, press ‘y’:

Here’s the installation snippet of installing Git on CentOS 8:

Git on Ubuntu

On Ubuntu, the simplest way to install git is to use an apt package manager. First, update the apt package index by using the below command:

Now, run the below command to install Git on Ubuntu:

$ sudo apt install git

If prompted to confirm, press ‘Y’:

Below is an installation log snippet for installation on Ubuntu 20:

Git on Windows

Windows binary installers are available from the official Git site. Download the applicable installer to your Windows system.

As of version 2.29.2, it offers 32 bit and 64-bit versions of Git; choose the one that matches your needs and system architecture. Most new systems support 64-bit architecture, and the default downloader provided by the site should be good for most purposes.