友情链接:
http://blog.csdn.net/auspi12341/article/details/52326187
**问题呈现:
如果使用yum自带的git版本(1.7.1版本)的话,拉取github或则gitlab上的代码时候,可能会出错误http failed****
但是呢,如果你选择ssh的话,是可以成功拉取的,但是对于laravel项目的话,其中composer的时候会出现一些问题:
(就是不使用Https拉取的话,对于一些特殊的项目比如支付类的,就会有些会拉取不下)
所以这里的最好还是要升级下git的版本到最新版本吧!!!
*首先卸载Linux自带的git
yum remove git***
下载最新git代码
wget -O git-master.zip https://github.com/git/git/archive/master.zip
编译
unzip git-master.zip
cd git-master
yum install openssl-devel curl-devel expat-devel perl-ExtUtils-MakeMaker gettext gettext-libs gettext-devel asciidoc xmlto docbook2X
ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
错误
libgit.a(utf8.o): In function reencode_string_iconv':
libiconv’
/usr/local/git/utf8.c:463: undefined reference to
libgit.a(utf8.o): In function reencode_string_len':
libiconv_open’
/usr/local/git/utf8.c:502: undefined reference to
/usr/local/git/utf8.c:521: undefined reference to libiconv_close'
libiconv_open’
/usr/local/git/utf8.c:515: undefined reference to
collect2: ld returned 1 exit status
make: * [git-credential-store] Error 1
**从错误提示看,是缺少libiconv。
安装libiconv****
****下载编译****
cd /usr/local
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure –prefix=/usr/local/libiconv && make && make install
**创建一个软链接到/usr/lib**
ln -s /usr/local/lib/libiconv.so /usr/lib
ln -s /usr/local/lib/libiconv.so.2 /usr/lib
**然后回到git目录继续编译**
cd /usr/local/git
make configure
./configure –prefix=/usr/local –with-iconv=/usr/local/libiconv
make
make install
*****此时,git应该编译安装成功了,测试如下:*****
$ git –version
git version 2.5.0