git版本更新小記

目前cenots版本爲7.2,自帶git@1.8.3,爲了體驗新功能,將git進行更新git

首先將原git進行刪除:github

# yum remove git

安裝依賴:bash

# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel

下載最新git:curl

# wget https://github.com/git/git/archive/v2.20.0.tar.gz

編譯並安裝:url

# tar -zxf v2.20.0.tar.gz
# cd git-2.20.0
# sudo make prefix=/usr/local all
# sudo make prefix=/usr/local install

添加環境變量:code

# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc

查看gitssl

# git --version
git version 2.20.0
參考資料: https://git-scm.com/book/en/v...
相關文章
相關標籤/搜索