首页 > 代码库 > centos上安装git

centos上安装git

按照这篇文章

安装依赖:

yum install curl
yum install curl-devel
yum install zlib-devel
yum install openssl-devel
yum install perl
yum install cpio
yum install expat-devel
yum install gettext-devel

下载git源码包:

https://github.com/git/git/releases

安装:

cd /git源码包解压路径
autoconf
./configure
make
make install

安装完毕后运行git若出现:“libiconv.so.2: cannot open shared object file”则:

在/etc/ld.so.conf中加一行“/usr/local/lib”,然后运行/sbin/ldconfig