/

CentOS yum 升级 git 版本

先去官网看看 Download for Linux and Unix:

RHEL and derivatives typically ship older versions of git. You can download a tarball and build from source, or use a 3rd-party repository such as the [IUS Community Project](https://ius.io/) to obtain a more recent version of git.

RHEL 和衍生通常提供较老版本的 git。您可以下载 tarball 并从源代码构建,或者使用第三方存储库,如 IUS Community Project 来获得最新版本的 git。

使用 IUS

RHEL/CentOS 7

yum install \
https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

安装新版 git:

ius 通常会在高版本的软件名后面 + u

yum list git

如果你已经装有低版本的 git,你需要先 remove(否则安装的时候会报错)

yum remove git

安装 2.0 以上版本的 git

yum install git2u

WANdisco

另一个源:WANdisco Replication Binaries

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

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

Import the repository GPG keys with:

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

sudo yum install git
git --version

References

– EOF –