使用安裝包安裝git

源碼安裝git

前奏:

yum install gcc

yum install zlib-devel  

yum install perl-ExtUtils-MakeMaker

 

1、卸載自帶git

yum remove git

2、進入git解壓目錄測試變量(在git解壓目錄下執行命令)

make configure
Centos7  Git源碼安裝 
注:報錯/bin/sh: autoconf: command not found,使用yum安裝autoconf即可

//然後重新執行測試命令

make configure
Centos7  Git源碼安裝

3、指定git安裝目錄

./configure --prefix=/usr/local/git
Centos7  Git源碼安裝

4、編譯git

make profix=/usr/local/git
Centos7  Git源碼安裝

5、安裝git

make install
Centos7  Git源碼安裝

6、設置環境變量

echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile

7、使環境變量生效

source /etc/profile

8、檢查git版本

git --version
Centos7  Git源碼安裝 
注:以上所有操作完成了最新版本的git×××!

 

感謝原作者: https://blog.51cto.com/13043516/2152749

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章