Linux上源码安装Git

安装依赖

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker

安装 libiconv

cd /usr/local/src
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

安装Git

make configure
./configure --prefix=/usr/local/git -with-iconv=/usr/local/libiconv
make
make install

配置环境变量

ln -s /usr/local/git/bin/* /usr/local/bin

查看Git版本“`shell

git –version
“`

发表评论