CentOS 7 升级git 2.17

Linux, 折腾 2018/05/15

安装环境、卸载原git

yum remove git -y
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc gcc perl-ExtUtils-MakeMaker -y

编译libiconv

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
tar zxvf libiconv-1.15.tar.gz 
cd libiconv-1.15
./configure --prefix=/usr/local/libiconv
make && make install

下载git源码并编译

wget https://github.com/git/git/archive/v2.17.0.tar.gz
tar xzvf v2.17.0.tar.gz 
cd git-2.17.0
make configure
./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv
make install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc

查看版本

git --version

本文标签:


评论(*号为必填项)