Skip to content

Some tips for working with RedHat or Centos

Install an up-to-date git client for RedHat 7

Prerequisite

Remove previous GIT installed (if any):

yum remove git

Using iuscommunity

It seems that this is no more working, see next section if it is not working.

First install a new depot

To be able to install a fresh GIT you will need another depot: iuscommunity, with depends on EPEL:

rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install http://dl.iuscommunity.org/pub/ius/stable/Redhat/7/x86_64/ius-release-2-1.el7.ius.noarch.rpm

Search a valid GIT version for your needs

Just run this command:

yum search git2

You should see different versions available, just pick the one you want.

Install the desired version

Assuming you want to install GIT 2.24:

yum install git224-core.x86_64 git224.x86_64

Using Wandisco Git repository

Add repository

With enough privileges run this command to create a WANdisco-git.repo file in /etc/yum.repos.d/ directory:

cat > /etc/yum.repos.d/WANdisco-git.repo << EOF
[WANdisco-git]
name=WANdisco Git
baseurl=http://opensource.wandisco.com/rhel/\$releasever/git/\$basearch
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-WANdisco
EOF

Add GPG key

Then import the GPG key from Wandisco:

rpm --import http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco

Intall Git

Simply run this command to install an up to date Git client:

yum install git

Checking

Now check that GIT is well installed and has the rght version:

git --version