准备工作
删除旧版本
1
2yum remove git
git --version安装需求
1
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
下载新版本
1
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
安装
编译
1
2
3
4tar -zxf git-2.9.5.tar.gz
cd git-2.9.5
make prefix=/usr/local/git all
make prefix=/usr/local/git install添加环境变量
1
2
3vim /etc/profile
export PATH=$PATH:/usr/local/git/bin
source /etc/profile查看版本
1
git --version