Installing Git 1.7 on Red Hat Enterprise Linux 5

I’ve used just about every version control system on the planet, from MS Visual Source Safe to CVS and SVN to Rational ClearCase and Rational Team Concert.  I’ve even had the unfortunate opportunity to use IBM CMVC.  Up until recently, I had never used the latest family of VCS’s known as Distributed VCS—namely Git and Mercurial.  The Internet is filled with flame wars on which one is better, but for our purposes we decided to use Git for a project I am working on because we are anticipating a highly distributed development model with a large number of developers (50+) contributing code and we like the flexibility to customize our development, build, and test workflows in various ways.  Git seems to offer the broadest range of options when it comes to workflow customization.

After reading up on how Git works from the official Git site and the Pro Git book, I found a very useful post on a successful Git branching model that describes how teams working in parallel on different parts of the code base can be successful with Git.  Based on this, I decided to create centralized ‘origin’ repository to fit with our development process,  andI took a stab at getting such an animal up an running on one of our development servers which happens to be running Red Hat Enterprise Linux 5 (RHEL5) .  It turns out that the standard installation of RHEL5 does not include Git, however it is relatively easy to install Git 1.5 from the “Extra Package” repository hosted by the Fedora project.  But Git 1.5 is two years old, how do you get a 1.7 release installed?  If you are a Linux power user, you might just be asking yourself where the source code is so you can build it and that certainly is one option, however I found a much easier way that I describe here:

  1. Tell Yum to use the EPEL repository.  See http://fedoraproject.org/wiki/EPEL/FAQ for details.  I just did this:
    rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
  2. Install Git 1.5 which will serve as a basis for upgrading to 1.7 by installing some needed dependencies. I used this command:
    yum install git
  3. As documented here, Todd Zullinger built some Git 1.7 RPMS for EPEL and put them here (http://tmz.fedorapeople.org/packages/epel/5/i386/).  Given that Todd already went through the hassel of building these from source, I figured I would save myself the trouble.  Thanks Todd.
  4. Download the following from Todd’s site:
    • gitweb-1.7.1-1.el5.1.i386.rpm
    • git-1.7.1-1.el5.1.i386.rpm
    • perl-Git-1.7.1-1.el5.1.i386.rpm
  5. Install the downloaded RPMs and voila! you are now running Git 1.7 on RHEL5.
    rpm -Uvh git-1.7.1-1.el5.1.i386.rpm 
             perl-Git-1.7.1-1.el5.1.i386.rpm
             gitweb-1.7.1-1.el5.1.i386.rpm

Leave a Comment