转载:https://www.molloc.com/archives/568
转载:http://www.111cn.net/sys/CentOS/82593.htm
# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
# yum install gcc perl-ExtUtils-MakeMaker
卸载Centos自带的git1.7.1
通过git –version查看系统带的版本,Cento6.5应该自带的是git版本是1.7.1
# yum remove git
下载git2.1.2并将git添加到环境变量中
安装git并添加到环境变量中
# cd git-2.1.2
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc
注意
执行make prefix=/usr/local all 报以下错误信息:
1
2
3
4
5
6
7
8
9
10
|
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
:
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历史简介
解决方法如下:
1.安装libiconv
2.创建一个软链接到/usr/lib