拉的docker hub centos镜像,原始GIT 用yum怎么装都是1.8 太旧了,记录一下省的以后找
# git --version
git version 1.8.3.1
系统版本:(CentOS 7.6)
cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
安装依赖
源代码安装和编译git,需安装一些依赖。
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
yum install gcc perl-ExtUtils-MakeMaker
卸载旧版本
yum remove git
安装步骤
# cd /usr/local/src/
# wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.23.0.tar.xz
# tar -xvf git-2.23.0.tar.xz
# cd git-2.23.0/
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
# source /etc/profile
验证版本
[root@localhost ~]# git --version
git version 2.23.0
原blog: https://www.cnblogs.com/Hi-blog/p/How-To-Update-Git-On-CentOS7.html