下载
wget https://www.kernel.org/pub/software/scm/git/git-2.14.3.tar.gz
安装依赖包
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
解压安装
tar -zxvf git-2.14.3.tar.gz
cd git-2.14.3
-
make prefix=/usr/local/git all
make prefix=/usr/local/git install
查看git所在的路径:
whereis git
git: /usr/local/git /usr/local/git/bin/git
配置环境
vi /etc/profile 在最后加:
export PATH=/usr/local/git/bin:$PATH
source /etc/profile
添加软链
ln -s /usr/local/git/bin/git /usr/bin/git