CentOS的yum源中没有git,只能自己编译安装,现在记录下编译安装的内容:

确保已安装了依赖的包:

yum install curl

yum install curl-devel
yum install zlib-devel
yum install openssl-devel
yum install perl
yum install cpio
yum install expat-devel
yum install gettext-devel



下载最新的git包

[root@lu usr]# wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz


[root@lu usr]# tar xzvf git-latest.tar.gz



[root@lu usr]# cd git-2013-07-24,

#你的目录可能不是这个,这个是具体的日期;


[root@lu git-2013-07-24]# autoconf


[root@lu git-2013-07-24]# ./configure


[root@lu git-2013-07-24]# make


[root@lu git-2013-07-24]# make install


如果顺利的话,到此安装完成,检查下安装的版本:


[root@lu git-2013-07-24]#git --version