Git官网
# 安装依赖包
[root@C7-01 ~]# yum install curl-devel expat-devel openssl-devel zlib-devel gcc
#解压
[root@C7-01 ~]# tar xvf git-2.30.0.tar.gz
[root@C7-01 ~]# cd git-2.30.0
# 编译安装
[root@C7-01 git-2.30.0]# make prefix=/usr/local/git all
[root@C7-01 git-2.30.0]# make prefix=/usr/local/git install
# 添加环境变量
[root@C7-01 git-2.30.0]# echo 'PATH=$PATH:/usr/local/git/bin' > /etc/profile.d/git.sh
[root@C7-01 git-2.30.0]# . /etc/profile.d/git.sh
# 查看版本
[root@C7-01 git-2.30.0]# git --version
git version 2.30.0