https://mirrors.edge.kernel.org/pub/software/scm/git/
下载
cd ~
wget -c https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.26.2.tar.xz
解压缩
tar -Jxvf git-2.26.2.tar.xz
安装编译工具
yum install -y curl-devel expat-devel gettext-devel openssl-devel \
zlib-devel gcc perl-ExtUtils-MakeMaker gcc-c++ gcc automake autoconf libtool make
检验相关依赖,设置安装路径
cd git-2.26.2
./configure --prefix=/usr/local/git
编译安装
make && make install
应用并生效
echo 'export PATH="/usr/local/git/bin:$PATH" ' >> /etc/profile.d/git.sh
source /etc/profile