Linux(Centos7.6)安装git2.17.0
- 下载链接:https://github.com/git/git/archive/v2.17.0.tar.gz
解压:
1
tar -zxvf v2.17.0.tar.gz
安装依赖:
1
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
安装依赖时,yum自动安装了Git,需要卸载旧版本Git
1
yum remove git #出现提示输入y即可
编译
1
cd git-2.17.0 & make prefix=/usr/local/git all
安装Git至/usr/local/git路径
1
make prefix=/usr/local/git install
配置环境变量
1
2
3vim /etc/profile
export PATH=$PATH:/usr/local/git/bin
source /etc/profile查看安装的git版本,有版本,安装成功
1
git --version