引言:大家好,我是熱愛coding,崇尚開源,樂于分享的【皮卡丘的貓】
Step1:安裝依賴包
yum install perl cpio curl curl-devel zlib-devel openssl-develexpat-devel gettex-devel -y
Step2:下載并編譯安裝
原始碼下載地址:https://github.com/git/git/releases
wget https://github.com/git/git/archive/v2.11.0-rc1.tar.gz
tar zxvf v2.11.0-rc1.tar.gz
cd git-2.11.0-rc1/
make configure
./configure --prefix=/usr/local/git
make
make install
make configure #注意這一步,默認無法直接進行./configure,不存在configure檔案,需要執行這一步,
./configure --prefix=/usr/local/git #安裝到/usr/local/git 目錄下面
Step3:配置環境變數
vim /etc/profile
# GIT_HOME settings
GIT_HOME=/usr/local/git
export PATH=$PATH:$GIT_HOME/bin
export GIT_HOME
Step4:使配置生效,查看git版本
source /etc/profile
git --version
特別注意:如果在安裝程序中報如下錯誤:autoconf:command not found,安裝以下依賴即可解決
yum install install autoconf automake libtool
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/291354.html
標籤:其他
