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
yum install curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel -y
下载最新的git包
wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz[这个网址已经过期了]
http://download.csdn.net/download/ee230/7339771
https://github.com/git/git/archive/master.zip
tar xzvf git-latest.tar.gz cd git-2011-11-30 #你的目录可能不是这个 autoconf ./configure make sudo make install
检查下安装的版本,大功告成
git --version
在centos7下遇到的问题:
Can't locate ExtUtils/MakeMaker.pm in @INC
yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker