1孝宗、使用yum安裝
# yum -y install git
# yum remove git
2困檩、源代碼安裝
---安裝依賴的包
# yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker zlib
# cd /usr/local
----下載git源碼
# wget https://github.com/git/git/archive/v2.21.0.tar.gz
----解壓git源碼
# tar -zxvf v2.21.0.tar.gz
# cd git-2.21.0/
# mkdir /usr/local/git
----編譯安裝到指定目錄
# make prefix=/usr/local/git all
# sudo make prefix=/usr/local/git install
# vim /etc/profile
----添加在文件的最后一行
export PATH=/usr/local/git/bin:$PATH
# source /etc/profile
# git --version
3仇让、FAQ
1、 如果解壓時(shí)出現(xiàn)報(bào)錯(cuò)酝掩,建議手動(dòng)下載git源碼包然后上傳到服務(wù)器
gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者