1.在线升级
- 1)查看git版本git --version
- 2)移除老版本git: yum remove git
- 3)下载git源
yum install http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm
- or -
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-1.noarch.rpm
- or -
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
- 4)安装新版本git:yum install git
- 5) 再次查看git版本
2.离线升级
- 1)下载文件:wget https://www.kernel.org/pub/software/scm/git/git-2.0.4.tar.gz
- 2)tar xzf git-2.0.4.tar.gz
- 3)配置
# cd git-2.0.4
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
#
# echo 'export PATH=$PATH:/usr/local/git/bin' >> /etc/bashrc
# or
# echo 'export PATH=$PATH:/usr/local/git/bin' > /etc/profile.d/git.sh
#
# source /etc/bashrc