wget https://github.com/git/git/archive/v2.17.0.tar.gz
tar -zxvf v2.17.0
解压后:git-2.17.0
拿到解压后的源码以后我们需要编译源码了,不过在此之前需要安装编译所需要的依赖
cd git-2.17.0/ #进入目录 yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker #安装依赖 make #在当前位置编译
export GIT_HOME=/home/pengbo.zhao/git-2.17.0 export PATH=$GIT_HOME:$PATH source /etc/profile
git --version
原文:https://www.cnblogs.com/MrRightZhao/p/11623034.html