How to Install Git 2.4.2 on CentOS/Redhat 7,6,5 and Fedora 20/19

http://tecadmin.net/install-git-2-0-on-centos-rhel-fedora/

Git has released 2.4.2 version on May 26, 2015.It has lots of noticeable changes over git 1.9 release. Git is a free and open source distributed version control system . It is designed to handle a small to very large projects with speed and efficiency. To know more about read gitrelease notes.

git-large-imge

This article will guide you to install Git 2.4.2 on CentOS/RHEL 7/6/5 and Fedora 20/19 Systems using source code. To learn about Git, access Git console on your browser and know about its uses.

Step 1: Install Required Packages

Firstly we need to make sure that we have installed required packages on your system. Use following command to install required packages before compiling Git source.

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

Step 2: Uninstall old Git RPM

Now remove any prior installation of Git through RPM file or Yum package manager. If your older version is also compiled through source, then skip this step.

# yum remove git

Step 3: Download and Compile Git Source

Download git source code from kernel git or simply use following command to download Git 2.4.2.

# cd /usr/src
# wget https://www.kernel.org/pub/software/scm/git/git-2.4.2.tar.gz
# tar xzf git-2.4.2.tar.gz

After downloading and extracting Git source code, Use following command to compile source code.

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

Step 4. Check Git Version

One completion of above steps, you have successfully install Git in your system. Let use following command to check git version

# git --version

git version 2.4.2