centos源码安装git最新版

到 git官网下载git 源码安装包,git官网地址:https://www.git-scm.com/

选择Tarballs系列的安装包,官网git下载:https://mirrors.edge.kernel.org/pub/software/scm/git/

选择最新的tar.gz结尾的安装包

#!/bin/bash
yum remove git -y
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker -y
cd /usr/local/src/
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
tar zxvf git-2.9.5.tar.gz
cd git-2.9.5
./configure --prefix=/usr/local/git/
make
make install
ln -s /usr/local/git/bin/git /usr/bin/
echo 'PATH=$PATH:/usr/local/git/bin' >> /etc/profile
source /etc/profile

 

[root@localhost ~]git --version

git version 2.9.5

猜你喜欢

转载自www.cnblogs.com/faberbeta/p/git003.html