Linux 下 Git版本升級


下載需要安裝的版本號
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.24.0.tar.gz
安裝需求
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
卸載Centos自帶的git:
yum remove git
git --version
安裝
tar -zxf git-2.24.0.tar.gz
cd git-2.24.0
make prefix=/usr/local/git all
make prefix=/usr/local/git install
添加環境變量
vim /etc/profile
export PATH=$PATH:/usr/local/git/bin
source /etc/profile
查看版本號
git --version
git version 2.24.0

centos默認的的yum倉庫中的默認版本很低,有時我們需要安裝高版本git,編譯安裝又太麻煩。
下面介紹一種yum安裝高版本git的方法

1,安裝 WANDisco 倉庫包

安裝 centos6 WANDisco 倉庫

yum install http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm

安裝 centos7 WANDisco 倉庫

yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm

2,安裝 Git
yum -y install git
3,版本驗證
git version
centos7 安裝快捷復制
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
yum -y install git
git version

yum install nss


免責聲明!

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



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