1. 安装开发环境
yum install -y curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel
2. 卸载旧版本git
yum remove git -y
3. 编译安装新版本git
3.1 编译并安装
git clone https://github.com/git/git.git ~/git
cd ~/git
autoconf
./configure
make -j4
su root
make install
ln -sf /usr/local/bin/git /usr/bin/git
3.2 配置
echo "export GIT_SSL_NO_VERIFY=1" > ~/.bash_profile (如果不加入这句会出现fatal Peer certificate cannot be authenticated with known CA certificate)