Fenying

Angus’ Home.


26 Dec 2016

第六章 安装最新版 Git 客户端

本章编译安装 Git 客户端的 2.11.0 版本。

0. 安装依赖

yum install expat expat-devel curl libcurl-devel python perl -y
yum remove git -y

cd /mnt/temp

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

tar -xzvf libiconv-1.14.tar.gz
cd libiconv-1.14

先修改 ./srclib/stdio.in.h 文件,把其中一行

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

注释掉。然后开始编译

./configure
make -j 4 && make install
cd ..
rm -rf libiconv-1.14

1. 开始编译

ln -s /usr/local/lib/libiconv.so.2 /usr/lib
ln -s /usr/local/lib/libiconv.so /usr/lib

tar -zxvf git-2.11.0.tar.gz
cd git-2.11.0
make configure
./configure \
    --prefix=/usr/local/git \
    --with-iconv=/usr/local/lib \
    --with-curl \
    --with-openssl \
    --with-libpcre \
    --with-editor=vi \
    --with-pager=less
make -j4
make install
ln -s /usr/local/git/bin/git /usr/bin

2. 检查安装

git --version
该文章根据 CC-BY-4.0 协议发表,转载请遵循该协议。
本文地址:https://fenying.net/book/minicentos-handbook/06.compile-git/

comments powered by Disqus