最近在使用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