centos7安裝 git-2.19.0.tar.gz

一、安裝編譯工具
yum -y groupinstall "Development Tools"git

二、安裝依賴包
yum -y install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel curl-devel expat-devel gettext-develgithub

三、下載 Git 最新版本的源代碼
wget https://www.kernel.org/pub/software/scm/git/git-2.19.0.tar.gz
登陸https://github.com/git/git/releases查看git的最新版。不要下載帶有-rc的,由於它表明了一個候選發佈版本。 bash

四、解壓
tar -zxvf git-2.19.0.tar.gzcurl

五、進入目錄配置
cd git-2.19.0
./configure --prefix=/usr/local/git
出現錯誤 -bash: ./configure: No such file or directory
查看官方文檔https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
git-2.19.0須要使用make configure命令ide

#make configure
GIT_VERSION = 2.19.0
GEN configure
若是出現 /bin/sh: autoconf: command not found
安裝一個autoconf工具

#yum install autoconf
再次運行make configure能夠了。
再執行
./configure --prefix=/usr/local/giturl

六、安裝
make && make install.net

七、配置全局路徑
export PATH="/usr/local/git/bin:$PATH"
source /etc/profilexml

八、查看git版本
git --versionblog


參考:
http://www.javashuo.com/article/p-phumqmie-hr.html
https://blog.csdn.net/zffeng123/article/details/82251668

相關文章
相關標籤/搜索