Centos6.9下编译安装GIT

https://git-scm.com/book/zh/v2/起步-安装-Git

1、确认当前没有装过git的rpm包(如有则卸载)
#yum y remove git
2、安装所需要的依赖:

yum install epel-release
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc docbook2X xmlto wget

3、这里需要做一个软连接,不然后续安装时会报/bin/sh: line 1: docbook2x-texi: command not found错误

ln -sv /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi

4、安装asciidoc

cd /usr/local/src
wget https://managedway.dl.sourceforge.net/project/asciidoc/asciidoc/8.6.9/asciidoc-8.6.9.tar.gz
tar zxf asciidoc-8.6.9.tar.gz
cd asciidoc-8.6.9
./configure
make install

5、下载git
git可以在https://github.com/git/git/releases下载
也可以在https://www.kernel.org/pub/software/scm/git下载

cd /usr/local/src
wget https://www.kernel.org/pub/software/scm/git/git-2.13.4.tar.gz
tar zxf git-2.13.4.tar.gz
cd git-2.13.4
make configure
./configure --prefix=/usr
make all doc info
make install install-doc install-html install-info

6、编译完成
查看版本:
git --version

你可能感兴趣的:(Centos6.9下编译安装GIT)