Centos 安装最新版git

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
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页