How To Install Git Latest Version 2.x On CentOS 7 / 8

You can install the latest version of git on CentOS 7/8 using the yum install git command on all the Linux but if you need a specific version, you will have to add repository or download the tar file from the git.

How To Install Git Latest Version 2.x On CentOS 7 / 8

Check the version by installing the EPEL repository using yum install epel-release -y and you will see the git 1.7 version available in this repository.

Git Version 2.x using repository:

You can install the WANdisco’s repository to get the latest version on your Linux machine. Use the below repository link to install according to your Linux OS version.

Check Out: How To Check User Login History On CentOS / Redhat 7/8

For CentOS 6:

yum install

For CentOS 7:

yum install

install git on centos

When you write “y” and hit the enter it will start the installation of Git on your machine. Once it’s done.

You can check the version using git –version command.

git version 2.22.0

we can also find the Git binary files location using whereis git command. when you configure Jenkins so you can use this path /usr/bin/git to integrate git with Jenkins.

git: /usr/bin/git /usr/share/man/man1/git.1.gz

Check Out: How To Install Brave Browser On Ubuntu 20.04/19.10

Install Git 2.22 Using Source code:

Install the required dependencies before compiling the source code using the below commands on your server.

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel -y
yum install gcc perl-ExtUtils-MakeMaker -y

Before installing the new version, you have to remove the older one form your machine using yum remove git -y command.

Check Out: How To Save Password In Google Chrome Browser

Now we will download the source file using the below URL.

cd /usr/src
tar -xvf git-2.5.3.tar.gz

Once you have extracted the tar file and go to inside the folder and run the following commands.

cd git-2.5.3
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo 'export PATH=/usr/local/git/bin:$PATH' >> /etc/bashrc
source /etc/bashrc

Check Out: How To Install Node.js And NPM On Ubuntu 19.10

Now you have to check the version using the below command.

git --version
git version 2.5.3

That’s it.

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment