采用yum安装的git版本是 1.x,目前git版本已更新至2.x,故采用自行下载包安装
1. 下载安装包
https://github.com/git/git/tags
传输至 云服务器
2. 解压
1 | [root@centos7 ~]# cd /app/ |
不安装会没有remote-http* 相关执行文件
1 | [root@centos7 git]# yum install libcurl-devel && yum install curl-devel |
进入目录
1 | [root@centos7 git]# cd git-2.37.1 |
安装automake,autoconf
1 | dnf search autoconf |
继续安装
1 | [root@centos7 git-2.37.1]# ./configure --prefix=/usr/local/git |
3. 关闭原有git
1 | [root@centos7 git-2.37.1]# cd / |
–nodeps 不查询依赖关系
4. 配置文件
1 | [root@centos7 profile.d]# cd ~ |