源碼安裝git
前奏:
yum install gcc
yum install zlib-devel
yum install perl-ExtUtils-MakeMaker
1、卸載自帶git
yum remove git
2、進入git解壓目錄測試變量(在git解壓目錄下執行命令)
make configure
注:報錯/bin/sh: autoconf: command not found,使用yum安裝autoconf即可
//然後重新執行測試命令
make configure
3、指定git安裝目錄
./configure --prefix=/usr/local/git
4、編譯git
make profix=/usr/local/git
5、安裝git
make install
6、設置環境變量
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
7、使環境變量生效
source /etc/profile
8、檢查git版本
git --version
注:以上所有操作完成了最新版本的git×××!