linux-cenos6.5下升级git到最新的版本

5 篇文章 0 订阅

友情链接:
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':
/usr/local/git/utf8.c:463: undefined reference to
libiconv’
libgit.a(utf8.o): In function reencode_string_len':
/usr/local/git/utf8.c:502: undefined reference to
libiconv_open’
/usr/local/git/utf8.c:521: undefined reference to libiconv_close'
/usr/local/git/utf8.c:515: undefined reference to
libiconv_open’
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

另外还有一个简洁的git升级版本的方法链接

http://www.jb51.net/article/97591.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值