首先确认在 CentOS 7 服务器已安装的 git 版本。
git --versiongit 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/
安装
sudo yum install git安装完成之后,检查 git 版本:
git --versiongit version 2.34.1