需要先添加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安装即可:
yum install git
From:http://51hired.com/questions/13038/centos%E4%B8%8A%E5%A6%82%E4%BD%95yum%E5%AE%89%E8%A3%85git
参考:什么是EPEL