CentOS7 升级 Git 版本

目录

安装依赖包

yum -y  install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc gcc perl-ExtUtils-MakeMaker tcl xmlto autoconf automake libtool unzip
  • libiconv-1.14.tar.gz
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

若报错:错误:‘gets’未声明(不在函数内),则需要编辑 libiconv-1.14/srclib/stdio.in.h:

_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");

# 改为:
#if defined(GLIBC) && !defined(UCLIBC) && !__GLIBC_PREREQ(2, 16)
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
#endif
  • asciidoc
wget --no-check-certificate https://jaist.dl.sourceforge.net/project/asciidoc/asciidoc/8.6.9/asciidoc-8.6.9.zip
unzip asciidoc-8.6.9.zip
cd asciidoc-8.6.9
./configure
nake && make install

安装 Git

wget https://github.com/git/git/archive/v2.2.1.tar.gz
tar zxvf v2.2.1.tar.gz
cd git-2.2.1
make configure
./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv
make all doc
make install install-doc install-html
echo "export PATH=$PATH:/usr/local/git/bin:/usr/local/git/libexec/git-core" >> /etc/bashrc

替换:

mv /usr/bin/git /usr/bin/git-1.8.3.1
ln -s /usr/local/git/bin/git /usr/bin/git
git --version
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页
实付 49.00元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值