源碼編譯git

最近在使用rebar3,而後在centos 6下面報錯,而後查到是git的版本過低致使的。html

報錯信息:git

Failed to fetch and copy dep: {git,"https://github.com/ninenines/cowboy.git",

具體緣由是:git 版本低於1.7.10,不支持single-branch特性。github

更新git就能夠了。centos

而後開始了在centos 6下面源碼安裝git:curl

1. 添加epel庫fetch

參考:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/url

## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

2.安裝依賴:spa

參考:https://git-scm.com/book/en/v2/Getting-Started-Installing-Gitcode

yum install -y curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel asciidoc xmlto docbook2X xz autoconf

ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi

3.編譯。xml

如今git的版本是2.8.1,從官網下載,而後解壓安裝。

$ tar -zxf git-2.8.1.tar.gz
$ cd git-2.8.1
$ make configure
$ ./configure --prefix=/usr/local/git-2.8.1
$ make -j4 all doc info
$ make test
$ sudo make install install-doc install-html install-info

最後把git添加到運行路徑就能夠了。

 

附加debian下面編譯最新版git的安裝依賴:

apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc xmlto docbook2x
相關文章
相關標籤/搜索