如何在 CentOS 7 上安装最新的 GIT 和 SVN?

How do I install the latest GIT and SVN on CentOS 7?

(Already solved, posting for the next guy)

我正在为 CentOS 7 设置 Git 和 Subversion 服务器 运行。

安装 Git 和 Subversion I 运行

yum install git

yum install subversion

这有效,但对于这两个版本,它都给了我当前不受支持的版本(SVN 1.7.14,Git 1.8.3.1)

我发现这个 Stack Overflow Question 讨论了安装 'latest' git,但是这个问题很老而且很复杂。

我也找到了有关如何自己编译它的资源,但我不太愿意这样做,而且它在未来与 yum 的交互似乎很奇怪。

那么,我怎样才能安装两者的最新版本呢?解决方案越简单越好。

我发现的最简单的方法是告诉 yum 到哪里寻找新版本。 为此,您需要为 yum

创建一个 .repo 文件

在我的系统中,这涉及:

cd /etc/yum.repos.d
vim wandisco.repo

在新文件中输入文本:

[WandiscoSVN]
name=Wandisco SVN Repo
baseurl=http://opensource.wandisco.com/centos/7/svn-1.9/RPMS/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco

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

这将在您尝试安装时引导 yum 查看 WANdisco 服务器。 那么运行

yum install git subversion

而且它们都应该更新到最新版本