Linux(centos7) git安裝
阿新 • • 發佈:2018-12-03
先到github上下載git的tar包 https://github.com/git/git/releases
上傳到linux並解壓
tar -zxvf git-2.19.1.tar.gz
進入目錄配置
cd git-2.19.0
先執行 yum install autoconf 因為要用到make configure,不然會報錯
yum install autoconf
make configure
./configure --prefix=/usr/local/git
安裝
yum -y install gcc automake autoconf libtool make
因為是沒有檔案openssl/ssl.h,安裝需要的依賴,使用命令:
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
make && make install
安裝成功
配置全域性路徑
export PATH="/usr/local/git/bin:$PATH"
source /etc/profile
檢視
git --version