layout: post
title: "Linx下安装Git"
date: 2016-05-09 23:25:34 +0800
comments: true
categories: [Linux]
考试季过去了,准备开始将日常使用迁移到Linux下,今天想在Linux下装Git,开始觉得这应该是个很简单的事,谁知道这个花了好多时间。
首先在网上找了一个博文作为参考,传送门
服务器端:
<pre class="prettyprint linenums">
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
wget https://github.com/git/git/archive/v2.2.0.tar.gz
tar zxvf git-2.2.0.tar.gz
cd git-2.2.0
make prefix=/usr/local all
make prefix=/usr/local install root用户运行
</pre>
如果编译时提示错误:
LINK git-credential-store
libgit.a(utf8.o): In function `reencode_string_iconv’:
/opt/git-master/utf8.c:530: undefined reference to `libiconv’
libgit.a(utf8.o): In function `reencode_string_len’:
/opt/git-master/utf8.c:569: undefined reference to `libiconv_open’
/opt/git-master/utf8.c:588: undefined reference to `libiconv_close’
/opt/git-master/utf8.c:582: undefined reference to `libiconv_open’
collect2: ld 返回 1
make: *** [git-credential-store] 错误 1
解决办法:
cd /usr/local/src/
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar -