1.下载最新版本git以下为地址并卸载旧版本git
https://github.com/git/git/releases
#卸载
yum -y remove git
2.传到指定目录解压
3.进入解压后的目录进行 编译
#编译之前先安装一个插件
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
#编译源码
make prefix=/usr/tool/git/git26 all
#安装
make prefix=/usr/local/git install
4.配置环境变量
export PATH=$PATH:/usr/local/git/bin
#刷新
source /etc/profile
#查看
git --version
遇到的问题:
红帽系统yum默认挂载在红帽,运行的时候要注册也就是需要付费,处理办法如下
https://blog.csdn.net/otmqixi/article/details/81564515