CentOS 7.3源码编译安装git

源码编译安装Git

1.下载

$ wget https://www.kernel.org/pub/software/scm/git/git-2.12.2.tar.gz

2.安装依赖

$ yum install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel
$ yum install curl-devel
$ yum install gcc 

3.解压

$ tar zxvf git-2.12.2.tar.gz
$ mv git-2.12.2 git
$ cd git

4.编译

$ ./configure
# 这里4的意思是4个线程去处理,这里根据电脑情况决定,方便多核电脑提高性能。将会安装在/usr/local/bin 下面
$ make -j4 && make -j4 install

5.再添加系统关联

$ ln -s /usr/local/bin/git /usr/bin/

6.查看是否配置正确

$ git --version