在服务器上升级git,但是默认的yum源中的git版本太老,所以只能通过编译源代码的方式安装
git version
或
git --version
yum install -y git
yum remove git
yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
wget https://github.com/git/git/archive/v2.9.2.tar.gz
tar -zxvf git-2.9.2.tar.gz
cd git-2.9.2
./configure --prefix=/usr/local/git //检验相关依赖,设置安装路径
make & make install //编译安装
vim /etc/profile
export GIT_HOME=/usr/local/git
export PATH=$PATH:$GIT_HOME/bin
source /etc/profile // 刷新权限
git version