$ yum remove git
$ wget --no-check-certificate https://www.kernel.org/pub/software/scm/git/git-2.8.4.tar.gz # 或者使用 curl -O -k https://www.kernel.org/pub/software/scm/git/git-2.8.4.tar.gz 进行下载
$ tar -zxvf git-2.8.4.tar.gz
$ yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel $ yum install -y gcc perl-ExtUtils-MakeMaker # 升级 解决 SSL connect error $ yum update -y nss curl libcurl
# 切换到git目录 $ cd git-2.8.4 # 建立要安装的目录 $ mkdir -p /usr/local/git # 编译安装 make prefix=/usr/local/git all make prefix=/usr/local/git install
# 添加环境变量 $ vim /etc/profile # 添加如下配置 $ export PATH=$PATH:/usr/local/git/bin
# 使新加的环境变量生效 $ source /etc/profile # 验证是否配置成功 $ git --version
TIPS
升级了git版本后git clone报ssl错误的解决方法
因为升级了git版本,git clone 的时候报了以下的错误
fatal: unable to access 'https://github.com/open-falcon/falcon-plus.git/': SSL connect error
解决方法 yum update -y nss curl libcurlpython
关于IUS
IUS第三方仓库不单单用于 git 的安装,它是包含了不少软件工具,它的使用指南里说明了一切
redis40u、redis32u、mysql56u、python36u、mysql
# Git第三方仓库安装方式(IUS) # 安装使用里面说的自动化安装脚本 $ curl https://setup.ius.io | sh # 能够看到 git2u相关内容 $ yum search git # ... # git.x86_64 : Fast Version Control System # git2u.x86_64 : Fast Version Control System # gitflow.noarch : Extensions providing operations for V. Driessen's branching model # 执行安装,并查看下版本 $ yum remove -y git | yum -y install git2u $ git --version