行业网站维护,买电脑wordpress,南京做网站公司 雷仁,临海建设局官方网站系统#xff1a; Centos 由于系统自带的yum源仓库的git版本较低#xff0c;所以在官网下载源码进行编译安装 官网地址#xff1a;https://git-scm.com/ 源码下载地址#xff1a;https://github.com/git/git 安装旧版本的git拉去git源码#xff08;如果是上传到服务器就不用…系统 Centos 由于系统自带的yum源仓库的git版本较低所以在官网下载源码进行编译安装 官网地址https://git-scm.com/ 源码下载地址https://github.com/git/git 安装旧版本的git拉去git源码如果是上传到服务器就不用了下载git了 [rootlocalhost ~]# yum -y install git拉取git源码 [rootlocalhost ~]# git clone https://github.com/git/git.git安装可能需要的依赖 [rootlocalhost ~]# yum -y install curl-devel expat-devel openssl-devel zlib-devel gcc-c
[rootlocalhost ~]# yum -y install perl-ExtUtils-MakeMaker automake autoconf libtool make编译安装 [rootlocalhost ~]# cd git/
[rootlocalhost git]# ./configure --prefix/usr/local/git # 安装在/usr/local目录下
[rootlocalhost git]# make make install卸载旧的git并将新安装的git设置环境变量 [rootlocalhost ~]# yum -y remove git
[rootlocalhost ~]# echo export GIT_HOME/usr/local/git /etc/profile
[rootlocalhost ~]# echo export PATH$PATH:$GIT_HOME/bin /etc/profile加载配置文件并查看git版本 [rootlocalhost ~]# source /etc/profile
[rootlocalhost ~]# git versiongit version 2.43.0