Skip to main content

Command Palette

Search for a command to run...

Installation of GIT on Linux-CentOS

Updated
2 min read
P

Welcome to my DevOps blog! My name is PAWAN JD BHAGAT, and I am a passionate DevOps Engineer with 6+ years of experience in the field. I created this blog to share my knowledge, experience, and insights on all things related to DevOps.

In this blog, you'll find a variety of content related to DevOps practices, tools, methodologies, and techniques. I'll cover everything from continuous integration and delivery, cloud computing, automation, and infrastructure as code, to monitoring and logging, security, and more. Whether you're a beginner or an experienced DevOps professional, you'll find valuable information and resources here.

I believe that DevOps is not just a set of practices or tools, but a mindset and culture that fosters collaboration, communication, and continuous improvement. Through my blog, I aim to promote this mindset and help organizations and individuals to adopt and implement DevOps practices in their work.

I encourage you to join the DevOps community and engage with me and other readers through comments and discussions. Let's share our experiences, learn from each other, and contribute to the growth of the DevOps community.

Thank you for visiting my blog, and I hope you find it useful and informative.

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

#git — — version

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 it's 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 installing wget, download the latest package of git, today date the latest version of git is 2.39.2 using the 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>

Step 3: - 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