CentOS 中安裝和更新 git 客戶端工具


CentOS 系統中有可能默認未安裝 git 工具,也有可能已安裝但是版本太低,這時候我們需要安裝或升級 git 工具。

1、檢查 git 是否已安裝

# git --version
-bash: git: command not found  # 情形一: git 未安裝
# git --version
git version 1.8.3.1           # 情形二: git 雖然已安裝,但是版本很太低

 

2、安裝 WANDisco 倉庫包

# 如果是 CentOS 6 系統就安裝這個吧
yum install http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm

# 如果是 CentOS 7 系統就安裝下面兩個之一吧
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-1.noarch.rpm
# 或者
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm

 

3、安裝或更新 git 工具

# 如果上面檢測到系統中未安裝git,則執行:
yum install git

# 如果上面檢測到系統中已安裝git,並且需要更新,則執行:
yum update git

# 安裝完成后檢測 git 版本
# git --version
git version 2.22.0

 

參考:https://stackoverflow.com/questions/21820715/how-to-install-latest-version-of-git-on-centos-7-x-6-x

 

完。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM