源码安装最新版本git

1、安装依赖

# yum install -y gcc gcc-c++ zlib zlib-devel perl-ExtUtils-MakeMaker curl curl-devel

2、下载git源码包

https://mirrors.edge.kernel.org/pub/software/scm/git/  

# wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
# cd  git-2.9.5
# ./configure --prefix=/usr/local/git
# make && make install

3、添加环境变量

# export PATH="/usr/local/git/bin:$PATH"
# git --version

 

posted @ 2020-07-09 21:33  浪淘沙&  阅读(222)  评论(0编辑  收藏  举报