centos7自带的源中git版本为1.8.3.1,比较旧的版本
1、确认你的当前git版本
在终端输入:
| 1 | git --version |
2、使用root账号
在终端终入:
| 1 | su root |
然后输入root账号的密码,注意linux下输密码时界面是没有变化的
3、配置存储库
启用Wandisco GIT存储库,在此之前我们先写入新yum存储库配置文件,在终端输入:
| 1 | vim /etc/yum.repos.d/wandisco-git.repo |
按i,进入插入模式,输入:
[wandisco-git]name=Wandisco GIT Repositorybaseurl=http://opensource.wandisco.com/centos/7/git/$basearch/enabled=1gpgcheck=1gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco |
按ESC键,然后输入:wq回车,保存存退出
4、导入存储库GPG密钥
在终端输入:
| 1 | sudo rpm --import http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco |
5、安装Git
在终端输入:
| 1 | yum install git |
6、验证Git版本
在终端输入:
| 1 | git --version |