(1)执行命令:
$ sudo yum install curl-devel expat-devel gettext-devel \ openssl-devel zlib-devel
(2)卸载旧版本git:
yum remove git
(3)下载git:
wget https://github.com/git/git/archive/v2.24.0.tar.gz
(4)解压:
$ tar -zxf git-2.24.0.tar.gz
(5)进入解压后的git安装目录:
$ cd git-2.24.0
(6)编译:
make prefix=/usr/local/git all
(7)安装:
make prefix=/usr/local/git install
(8)编辑环境变量配置(给到所有用户):
vim /etc/profile
(9)profile文件末尾追加:
export PATH=$PATH:/usr/local/git/bin
(10)刷新配置:
source /etc/profile
(11)查看版本:
git —version