0)安装依赖软件
[root@uatjenkins01 ~]
[root@uatjenkins01 ~]
1)卸载系统自带的底版本git(1.7.1)
[root@uatjenkins01 ~]
git version 1.7.1
[root@uatjenkins01 ~]
2)编译安装最新的git版本
[root@uatjenkins01 ~]
[root@uatjenkins01 src]
[root@uatjenkins01 src]
[root@uatjenkins01 src]
[root@uatjenkins01 git-2.15.1]
[root@uatjenkins01 git-2.15.1]
[root@uatjenkins01 git-2.15.1]
[root@uatjenkins01 git-2.15.1]
[root@uatjenkins01 ~]
git version 2.15.1
======================================================================
如果是非root用户使用git,则需要配置下该用户下的环境变量
[app@uatjenkins01 ~]$
echo
"export PATH=$PATH:/usr/local/git/bin"
>> ~/.bashrc
[app@uatjenkins01 ~]$
source
~/.bashrc
[app@uatjenkins01 ~]$ git --version
git version 2.15.1
https://www.cnblogs.com/kevingrace/p/8252517.html