CentOS7 如何升級Git

CentOS7自帶的git版本1.8.3.1,這個版本有點低了。因而決定折騰升級,我首先想到的是用update更新:linux

yum update git

結果,事與原違,仍是1.8.3.1。在網上提供的升級方案,其本上都是先刪除原來的,而後在官網上下載最新的,本身make,可是很折騰人啊,make過程當中也是各類報錯,一個個解決,累覺不愛。git

無心中在網上看到,另外一個思路,記錄在此:vim

一、確認你的當前git版本centos

在終端輸入:bash

git --version

 

二、使用root帳號url

在終端終入:blog

su root

 而後輸入root帳號的密碼,注意linux下輸密碼時界面是沒有變化的it

 

三、配置存儲庫io

啓用Wandisco GIT存儲庫,在此以前咱們先寫入新yum存儲庫配置文件,在終端輸入:class

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回車,保存存退出

 

四、導入存儲庫GPG密鑰

在終端輸入:

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

 

五、安裝Git

在終端輸入:

yum install git

 

六、驗證Git版本

在終端輸入:

git --version
相關文章
相關標籤/搜索