1.确定当前版本
git --version
2.切换root用户
su root
3.配置存储库
启用Wandisco GIT存储库,在此之前我们先写入新yum存储库配置文件,在终端输入:
vim /etc/yum.repos.d/wandisco-git.repo
按i,进入插入模式,输入:
[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
按ESC键,然后输入:wq回车,保存存退出
4.导入存储库GPG密钥
在终端输入:
sudo rpm --import http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
5、安装Git
yum install git
6、验证Git版本
git --version