不灭的焱

加密类型:SHA/AES/RSA下载Go
复合类型:切片(slice)、映射(map)、指针(pointer)、函数(function)、通道(channel)、接口(interface)、数组(array)、结构体(struct) Go类型+零值nil
引用类型:切片(slice)、映射(map)、指针(pointer)、函数(function)、通道(channel) Go引用

作者:AlbertWen  添加时间:2021-09-17 22:53:53  修改时间:2025-11-25 03:24:39  分类:06.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