升级yum版本
需要先添加EPEL(Extra Packages for Enterprise Linux) repository:
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
然后yum install git就能安装了。
参考:http://fedoraproject.org/wiki/EPEL/FAQ#HowcanIinstallthepackagesfromtheEPELsoftwarerepository.3F
转贴:http://51hired.com/questions/13038/centos%E4%B8%8A%E5%A6%82%E4%BD%95yum%E5%AE%89%E8%A3%85git