本文讲述linux下编译安装git的过程。 
参考内容

一、下载源代码

https://www.kernel.org/pub/software/scm/git/ 
在该网址下载你所需版本的git源码,如 
$ wget https://www.kernel.org/pub/software/scm/git/git-1.9.5.tar.gz

二、安装所需工具

$ sudo yum install curl-devel expat-devel gettext-devel \ 
openssl-devel zlib-devel
或 
$ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \ 
libz-dev libssl-dev

三、编译安装

$ tar -zxf git-1.9.5.tar.gz 
$ cd git-1.9.5 
$ ./configure --prefix=/usr 
$ make 
$ sudo make install

四、设置环境变量

在主目录的.bash_profile或者/etc/profile文件加入设置环境变量 
export PATH=/usr/libexec/git-core:$PATH

然后重启登录或者source一下该文件使其生效。


CentOS6.3编译安装安装git2.3.4提示:

Can't locate ExtUtils/MakeMaker.pm in @INC

解决:

yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker


Logo

更多推荐