一.下载、解压
1.下载git安装包
官网下载地址: https://mirrors.edge.kernel.org/pub/software/scm/git/
wget --no-check-certificate -P /home/pengbo.zhao https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.20.0.tar.gz
#认证下载指令
#-P /home/pengbo.zhao 下载到指定目录
2.上传
3.解压
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 prefix=/home/pengbo.zhao/git #在当前位置编译
make prefix=/home/pengbo.zhao/git install #安装
三.配置环境变量、验证
export GIT_HOME=/home/pengbo.zhao/git-2.17.0 export PATH=$GIT_HOME:$PATH source /etc/profile
git --version
四.可能遇到问题
https://blog.csdn.net/weixin_30496751/article/details/98773556