How to install latest version of Git on Centos 7

git logo

The git version that yum installs on Centos is quite old. I will go through installing the latest version of Git on Centos 7 from the source code.

 

Environment:

  • OS Version: Centos 7.3
  • Git that comes with yum: v1.8
  • Current latest git: v2.12.2

Install Dependencies

sudo yum -y update
sudo yum groupinstall "Development Tools"
sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel

Download and install latest package

cd /opt/
sudo wget https://github.com/git/git/archive/v2.12.2.tar.gz \
  -O git-2.12.2.tar.gz 
sudo tar -zxf git-2.12.2.tar.gz
cd git-2.12.2/
sudo make configuresudo ./configure --prefix=/usr/local
sudo make install

1 Comment

Leave a Comment

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

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