How to install Git 2.18 on CentOS

Git is an open source distributed version control system. This tutorial I will install Git 2.18 client on centos.

Jenkins release source error code as below:

/remotes/origin/*" returned status code 128: error: The requested URL returned error: 401 while accessing https://github.com/xxx/xxx/info/refs
fatal: HTTP request failed

Solve problem Required Git >= 1.7.10

Step 1: Install the required packages

Before install git makes sure you have installed in package your system.

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

Step 2: Installing git on centos

Downloading Git source code from kernel git

cd /usr/src
wget https://www.kernel.org/pub/software/scm/git/git-2.18.0.tar.gz
tar xvzf git-2.18.0.tar.gz

After extracting git source code and compile the source code

cd git-2.18.0
make prefix=/usr/local/git all
make prefix=/usr/local/git install

Step 3: Setup Environment

Set the PATH variable and reload the change in the current environment

echo "export PATH=/usr/local/git/bin:$PATH" >> /etc/bashrc
source /etc/bashrc

After complete the steps. Check git version on your system.

git --version

Conclusion

Thought the article, You can “install Git 2.18 on CentOS as above. I hope will this your helpful.

,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created DevopsRoles.com site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment moderation is enabled. Your comment may take some time to appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.