How to Install Git on Linux

Last Updated : 7 May, 2026

Git is an open-source, distributed version control system designed to help developers coordinate, collaborate, and manage software projects efficiently. It allows developers to track changes in source code, create and manage branches, and work simultaneously on the same project while maintaining a complete and reliable history of changes.

Core Functions of Git:

  • Tracks changes made to files over time
  • Git Supports collaboration among multiple developers
  • Maintains a complete version history of projects
  • Allows easy branching and merging of source code
  • Enables developers to work independently without affecting the main codebase

Before installing Git, check whether it is already available on your system:

git --version

If Git is installed, the command will display the installed version. If not, proceed with the installation steps below.

Steps to Download and Install Git on Linux

To download Git on Linux, and install it on any utility in Linux, updating the system to the latest one is essential. Hence, please run the following Git commands one by one:

1. Git Installation Commands For Ubuntu

Following are 2 simple steps to get Git in Ubuntu

Step 1: Update the System

  • Run these commands to update your system’s package list and install the latest versions of packages.
sudo apt update
sudo apt upgrade

Step 2: Finish the Git Installation

  • Use this command to install Git along with additional packages.
install
install git
sudo apt install git-all

Step 3: Verify Installation

  • Use the below command to varify the installation of Git in Ubuntu.
version
Check Version
git --version

2. Git Installation Commands For Fedora

Following are 2 simple steps to get Git in Fedora

Step 1: Install the Latest Version

Run these commands to update your system’s package list and install the latest versions of packages.

sudo dnf update
sudo dnf upgrade

Step 2: Complete the Git Installation

Use this command to install Git along with additional packages.

sudo dnf install git-all

Step 3: Verify Installation

  • Use the below command to varify the installation of Git in Fedora
git --version

3. Git Installation Commands For CentOS/RHEL

Following are 2 simple steps to get Git for CentOS/RHEL

Step 1: Update the System

  • Run these commands to update your system’s package list and install the latest versions of packages.
sudo yum update
sudo yum upgrade

Step 2: Install Git on CentOS/RHEL

  • Use this command to install Git along with additional packages.
sudo yum install git-all

Step 3: Verify Installation

  • After download Git, you check its version using by running the below git version command:
git --version
file
Installation
Comment