Loading
0

CentOS 7 安装git2

删除旧版git:

sudo yum remove git*

安装:

curl https://setup.ius.io | sh
yum install git224-all.noarch

sudo yum install  https://centos7.iuscommunity.org/ius-release.rpm
sudo yum install  git2u-all

也可以源码安装:

官方下载:https://github.com/git/git/releases

解压:

tar -zxvf git-2.8.4.tar.gz

安装依赖包:

yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install -y gcc perl-ExtUtils-MakeMaker
# 升级 解决  SSL connect error
yum update -y nss curl libcurl
mkdir -p  /usr/local/git
make prefix=/usr/local/git all
make prefix=/usr/local/git install

编辑profile:

vim /etc/profile

导出路径:

export PATH=$PATH:/usr/local/git/bin
source /etc/profile

参考:

最后编辑于:2020/12/13作者: 编程小战

我不入地狱,谁入地狱?

评论已关闭