CentOS 7 服务器已安装的 git 版本。git --version
git version 1.8.3.1使用 yum 安装
移除旧版本
sudo yum remove git sudo yum remove git-*添加 End Point Package Repository
在
CentOS 7 上安装新版本 Git 最快的方法是通过 End Point 库。sudo yum install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm其他版本的
CentOS 替换成对应版本安装,可参考:packages.endpointdev.com/安装
添加了
end point 库,就可以直接安装 git 2.xsudo yum install git安装完成之后,检查
git 版本:git --version
git version 2.34.1参考资料:
https://juejin.cn/post/7071910670056292389