Git is a version-control system, which is used for tracking updates in computer files. Additionally, it may be used for collaborating work on files among a group of people. This article will provide the reader with a step by step information on how to install Git on RHEL 8 / CentOS 8.

In this tutorial you will learn:
  • How to install Git from a standard RHEL 8 / CentOS 8 repository.
  • How to compile and install Git from source code.
  • How to check Git version.
Version-control system Git on Red Hat Enterprise Linux 8
Version-control system Git on Red Hat Enterprise Linux 8

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System RHEL 8 / CentOS 8
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ - requires given linux commands to be executed as a regular non-privileged user

Install Git from a standard RHEL 8 / CentOS 8 repository step by step instructions

$$$ Looking for LINUX ADMINISTRATOR ! $$$

BLUE SKY STUDIOS are looking for Linux Administrator to maintain and support the Studio's 450+ production Linux workstations, including daily interactions with the Studio’s digital animation artists.
LOCATION: Greenwich, Connecticut, USA


Chances are that the git command is already available on your RHEL 8 system. Execute git --version to check whether the git tool is already installed.

  1. Use the dnf command to install the package git:
    # dnf install git
  2. Confirm installation by checking the git command version number:
    $ git --version
    git version 2.18.1

Compile and Install Git from a source code step by step instructions

In case you need to install a specific Git version on your RHEL 8 system then use the below steps to compile and install Git from a source code.

  1. Use the dnf command to install all prerequisites:
    # dnf install wget unzip tar make gcc openssl-devel libcurl-devel expat-devel
  2. Download the Git source code package URL from official git repository. Either download the latest master version or use tags to download any other available git version.

    Download Git source code
    Obtain git source code zip package URL
  3. Use the wget command to download the git source zip package. For example in this case we are downloading the git version v2.20.1:
    $ wget
  4. Unzip the git source code:
    $ unzip
  5. Navigate to the git source code directory:
    $ cd git-2.20.1/
  6. Compile and install git:
    # make prefix=/usr/local all install
  7. Confirm git installation:
    $ git --version
    git version 2.20.1
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
Get extra help by visiting our LINUX FORUM or simply use comments below.