Saturday, July 07, 2018

CetnOS7 - How to Install Git 1.9

The latest version of Git from the default CentOS7 repository is 1.8, to upgrade your git version to 1.9, you will need to install it from the Centos pkgs.

Install CentOS SCLo RH Testing repository:

$ sudo yum install
Install git19 rpm package:
$ yum install git19

Then, you will need to symlink the latest version:
$ sudo mv /usr/bin/git /usr/bin/git-old
$ sudo ln -s /opt/rh/git19/root/usr/bin/git  /usr/bin/git

Test it out:
$ git --version
git version 1.9.4

Or you can install it from the source:

Before you begin, you'll need to install the software that git depends on. These dependencies are all available in the default CentOS repositories, along with the tools that we need to build a binary from source:

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

Download the git version from git releases:
$ wget https://github.com/git/git/archive/v1.9.2.tar.gz -O git.tar.gz

Unpack it:
$ tar -zxf git.tar.gz

Configure and Install:
$ make configure
$ ./configure --prefix=/usr/local
$ sudo make install

No comments: