系统环境:CentOS release 6.8 (Final)
默认Git :1.7.1
需求git :2.11
卸载centos自带的git:yum remove git -y
下载git-2.11.0.tar.gz 上传至服务器,下载链接:http://distfiles.macports.org/git/
解压安装git 并添加git到环境变量
cd/usr/local/src/ tarzxvfgit-2.11.0.tar.gz makeprefix=/usr/local/gitall makeprefix=/usr/local/gitinstall 添加git到环境变量 echo"exportPATH=$PATH:/usr/local/git/bin">>/etc/bashrc 或者 echo"exportPATH=$PATH:/usr/local/git/bin">>/etc/profile source/etc/bashrc或者source/etc/profile
查看git版本号
[root@localhostgit-2.11.0]#git--version gitversion2.11.0原文链接:https://www.f2er.com/centos/378661.html