centos7安装 git-2.19.0.tar.gz

一、安装编译工具
yum -y groupinstall "Development Tools"git

二、安装依赖包
yum -y install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel curl-devel expat-devel gettext-develgithub

三、下载 Git 最新版本的源代码
wget https://www.kernel.org/pub/software/scm/git/git-2.19.0.tar.gz
登陆https://github.com/git/git/releases查看git的最新版。不要下载带有-rc的,由于它表明了一个候选发布版本。 bash

四、解压
tar -zxvf git-2.19.0.tar.gzcurl

五、进入目录配置
cd git-2.19.0
./configure --prefix=/usr/local/git
出现错误 -bash: ./configure: No such file or directory
查看官方文档https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
git-2.19.0须要使用make configure命令ide

#make configure
GIT_VERSION = 2.19.0
GEN configure
若是出现 /bin/sh: autoconf: command not found
安装一个autoconf工具

#yum install autoconf
再次运行make configure能够了。
再执行
./configure --prefix=/usr/local/giturl

六、安装
make && make install.net

七、配置全局路径
export PATH="/usr/local/git/bin:$PATH"
source /etc/profilexml

八、查看git版本
git --versionblog


参考:
http://www.javashuo.com/article/p-phumqmie-hr.html
https://blog.csdn.net/zffeng123/article/details/82251668

相关文章
相关标签/搜索