不灭的焱

革命尚未成功,同志仍须努力下载JDK17

作者:Albert.Wen  添加时间:2021-09-17 22:53:53  修改时间:2024-04-15 11:38:50  分类:Linux软件安装/参数优化  编辑

CentOS 7 默认的git版本是1.8.x

sudo yum -y install git

即使升级

sudo yum -y upgrade git

依然没有升级到2.x版本

解决方案如下:

1、新增仓库

新增 Wandisco GIT repository

sudo vim /etc/yum.repos.d/wandisco-git.repo

在文件(/etc/yum.repos.d/wandisco-git.repo)中加入内容

[wandisco-git]
name=Wandisco GIT Repository
baseurl=http://opensource.wandisco.com/centos/7/git/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco

插入仓库

sudo rpm --import http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco

2、安装

sudo yum -y install git

3、查看版本

git --version

输出:

git version 2.31.1