1.下载git版本安装路径
命令:wget https://github.com/git/git/archive/v2.21.0.tar.gz
2.安装依赖包
命令:yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
3.解压
命令:tar -zvxf v2.21.0.tar.gz
4.进入解压目录
命令:cd git-2.21.0/
5.编译
命令: make prefix=/usr/local/git all
6.安装Git在/usr/local/git路径
命令:make prefix=/usr/local/git install
7.配置环境变量
命令:vim /etc/profile
在末尾添加export PATH=/usr/local/git/bin:$PATH
8.source一下立马生效
命令:source /etc/profile
9.校验一下
命令:git version
安装成功
我要这天再遮不住我眼,要这地再埋不了我心。要这天下众生都明白我意,要那诸佛都烟消云散!