Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I go to Gits download section it mentions that latest version is 1.8 and I can install it by yum install git on Fedora. I'm running CentOS6 so that command should also work for me, but yum tells me:

Setting up Install Process
Package git-1.7.1-2.el6_0.1.x86_64 already installed and latest version
Nothing to do

Is my yum pointing to old repositories? Or I'm doing something worng?

Thanks!

EDIT: I understand that vendors are not always up to date with their package list, so does that mean the documentation on git website is incorrect on the fact that they tell me to download it using yum while vendors haven't updated their package lists?

share|improve this question
1  
How can the Git people possibly speak for the various packagers representing the various Linux distributions. –  mdpc Nov 14 '12 at 23:24
4  
How does the statement It is easiest to install Git on Linux using the preferred package manager conflict with the idea that you will not be getting the latest-greatest version? It is easiest to install the packaged version of git. Most people don't need the absolute latest version of git. If you want to live on the bleeding edge, then you don't get to choose the easy path. Download the source and build it, or look for a appropriate 3rd party repos where someone else has done the hard work. –  Zoredache Nov 15 '12 at 0:29
    
Red Hat rarely changes the major version of a software package to maintain stability. Since git is at 1.7.1 today, it may always remain at 1.7.1 (Security fixes are backported in). You're only choice is to install from source or install an RPM from a third party repository. @muness's solution below worked great for me, and now I'm at 1.7.11, which is good enough to support most features I need on github.com . –  Stefan Lasiewski Jul 2 '13 at 3:00
1  
does that mean the documentation on git website is incorrect -- yes, their website is incorrect. Github.com is a great tool, but their documentation definitely contains mistakes and is ambiguous in some places. Some critics will point out mistakes like this and say, "Oh right, they're 'agile'". –  Stefan Lasiewski Jul 2 '13 at 3:04
    
Fedora and CentOS aren't the same. They're both based on RedHat Linux, but you can't assume that a given command will always have the same effect on one as the other. Package management in particular is one of the areas of widest divergence. –  Ben Collins Apr 29 at 15:55
add comment

5 Answers 5

up vote 3 down vote accepted

Your OS vendor (the CentOS project) may not have built a package for the latest version of git yet (or they may not be planning to, and instead intend to stick with the 1.7.x series in CentOS 6).

Software does not magically appear in packaging systems the day it's released by its author - packages need to be built, tested, approved, and pushed. If you require a version that your upstream vendor isn't shipping you can always build it yourself...

share|improve this answer
    
Yes I understand the concept, so what Git has on their website is wrong? "To get 1.8 use yum" ? –  Reza Sanaie Nov 14 '12 at 23:01
4  
The Git people cannot speak for the various packagers representing the various Linux distributions. –  mdpc Nov 14 '12 at 23:23
2  
@RezaSanaie Where are you finding that quote on the git (git-scm.com) website. They're much smarter than to make a claim like that. As Zoredache pointed out, they say it's EASIEST to use your OS package manager (to get a version of git). If you need the latest and greatest you should be building it yourself. –  voretaq7 Nov 15 '12 at 1:33
1  
When it says "Latest stable release 1.8.0 Release Notes (2012-10-21) Download for Linux" and I click on it I normally expect to get that –  Reza Sanaie Nov 15 '12 at 1:35
1  
@RezaSanaie - in that case may I suggest that you send Git an email and raise your complaints about how they have worded their website. It won't change the situation but it might clear up future confusion. –  Mark Henderson Nov 15 '12 at 1:56
show 1 more comment

Here's what worked for me:

  1. Enabled RPMForge
  2. yum install yum-plugin-priorities # install the yum priorities plugin via
  3. Enabled the RPM Forge Extras repo by editing /etc/yum.repos.d/rpmforge.repo and changed enabled to 1 in the rpmforge-extras section. I also bumped up the priority of both rpmforge repos to 1 by adding priority = 1 to both sections.
  4. yum remove git
  5. yum clean all && yum update && yum install git
share|improve this answer
add comment

For stability, enterprise-oriented distributions like CentOS tend to stick with the major release of the tools that was present when the OS was released. Third-party repositories can be used to bump up to higher versions, but it's often not necessary. If Git 1.7 is working nicely for you, you should be fine sticking with it.

share|improve this answer
3  
The Git people cannot speak for the various packagers representing the various Linux distributions. –  mdpc Nov 14 '12 at 23:22
add comment

It's super easy to download the source and compile it yourself, I even found RPMForge method kind of cumbersome.

Download Git 2.0 source and

    make configure ;# as yourself
    ./configure --prefix=/usr ;# as yourself
    make all ;# as yourself
    make install install-doc install-html;# as root

I needed to install a couple of dependencies before make fully succeeds.

sudo yum install libcurl-devel
share|improve this answer
add comment

CentOS supports a "parallel" universe of newer compilers and tools, that doesn't clobber the older versions. You want

yum install devtoolset-2

Once it is installed, do

scl enable devtoolset-2 bash

which will modify your path. You'll have the old version of git in /usr/bin/git, and the newer version in /opt/rh/..../git. The newer one is 1.8.4/.

You also get newer g++ (4.8), etc.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.