1、安装git依赖包
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
2、删除已有的git
yum remove git
3、下载git源码
切换到你的包文件存放目录下
cd /opt
下载git安装包(git所有版本下载)
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.14.2.tar.gz
4.解压git安装包
tar -zxvf git-2.14.2.tar.gz
cd git-2.14.2
5.配置git安装路径
./configure prefix=/usr/local/git/
编译并且安装
make && make install
查看git版本号
git --version git已经安装完毕
原文:https://blog.csdn.net/qq_37495786/article/details/81977454