1、按照git
yum install git
#升级git 先卸载 yum remove git
下载 wget https://github.com/git/git/archive/v2.22.0.tar.gz
解压 tar -zxvf v2.22.0.tar.gz
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
2、进入解压的文件夹,执行安装命令
cd git-2.22.0
make CFLAGS=-liconv prefix=/usr/local/git all # 执行安装,命令为,安装到/usr/local/git make CFLAGS=-liconv prefix=/usr/local/git install
安装成功查看
git --version