Installation of GIT on Linux

Pawan Bhagat
2 min readFeb 22, 2023

--

Version Control System

Before installing the GIT first, we have to verify that GIT is not there

#git — — version

Verification for git software

That means GIT is not installed on our system

There are two ways to install the GIT on our system

  1. We have to download the source code and make a build and then we can install it.
  2. Using YUM, (but its installed an older version of git)

We are installing GIT through option one

Option-1:- Installing the latest version of git from the IUS repository

Step 1:- Install Development Tools

Go to :- cd /etc/yum.repos.d

#yum group install “Development Tools”

#yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel

Step 2:- Now we are going to build

We have to download the package using the wget command If the wget tool is not installed then first we have to install it using the below command

Verify:-

#which wget

If not present then install it through the below command

#yum install wget

After install wget, download the latest package of git, today date the latest version of git is 2.39.2 using below command and link

#wget https://www.kernel.org/pub/software/scm/git/git-2.39.2.tar.gz — no-check-certificate

After downloading Extract the file

#tar -xvf <file_name>

Once it extracts go into the file

#cd <file_name>

Now we have to buit the process

#make configure

Now we have to define where the built has to be saved

#./configure –prefix=/usr/local

#make install

Verify: -

#which git

#git — — version

Congratulations, you have successfully latest version of GIT on your local machine

Option-2:- Installing the GIT using YUM

To install Git on CentOS, follow these simple steps

  1. Open the terminal on your CentOS machine
  2. Type the following command to install Git:

#sudo yum update

#sudo yum install git -y

#git — version

Press Enter to confirm the installation.

Wait for the installation to complete

That’s it! Git should

I hope you found this post helpful. Happy coding!

Thank You!

Pawan Bhagat

--

--