Install a newer version of Git on CentOS 7

Solution 1:

You could use a IUS repository ( as provided on Git official site here. It contains prebuilt binaries for x86_64.

To do that, run (as root):

yum install epel-release
yum remove git
rpm -U
yum install git2u

(centos7 can be replaced with centos6 or rhel{6,7} if you are not using CentOS).

Another option would be to use another RPM repository (i386 & x86_64):

sudo yum -y install
sudo yum install git

Solution 2:

Building from source is quite straightforward. Digital Ocean has a nice guide on building Git from source on CentOS 7. Place the resulting binary in /usr/local/bin/ on your CentOS 7 system (which, by default, is included in your $PATH) and you're good to go.

Of course you would prefer packages/using the repo, however given your situation I would not hesitate building it myself.

For general information; Push to Deploy was introduced in Git 2.3.0. Make sure to use this version or above.

Solution 3:

I have this approach for CentOS 7.2:

rpm -U \
    && yum install -y git

At the moment I have 2.10.0 GIT version.

Or for CentOS 7.1 the same path but wandisco-git-release-7-1.noarch.rpm.

You may inspect available releases

Solution 4:

Red Hat maintains a software collection for Git 2.9:

This is the easiest and safest way to get Git 2.x on CentOS.