How to Install Latest GIT on RHEL 6/CentOS 6

How to Install Latest GIT on RHEL 6/CentOS 6

So you want to setup a GIT Repository for your developers on RHEL 6/CentOS 6, but notice Red Hat Enterprise Linux 6 contains 1.7.1 in the repositories, which is well behind the current 1.8.3 that is available for GIT at

Well no need to worry, it is easy enough to download and install the latest on a typical RHEL/CentOS installation.

First let’s download all the files that are required for GIT installation:

$ wget
$ wget -O git-manpages-

Next, install all required libraries before building GIT:

$ sudo yum install zlib-devel perl-CPAN gettext

Now let’s untar and build and install GIT in the /usr directory:

$ tar xvfz git-
$ cd git-
$ ./configure
$ make
$ sudo make prefix=/usr install
$ git --version
git version

That’s all you need and now you are ready to configure your repository for access and start developing!

Now if you want to update GIT you can do that using GIT itself:

$ git clone git://
  • Gaurav Sharma

    worked like a charm, thanks :-)

  • Slim

    thanks. This all installed easily but where do I find how to reference the repository now that it is installed? What would the URL be or how do I configure this part. Thanks!

  • Ashish

    Thanks… I was stuck on dependency.

  • Smishmi Grishmi

    This worked but I was unable to ‘git clone’ from an ‘https’ without first installing curl-devel. I figured this out here:

  • Mahony

    thanks a ton, this info helped more than the one on git-scm.

  • dmc

    Thanks. Very useful article.

  • Rob Vanstone

    Really good and accurate guide – thanks