- 下载最新源码
源码地址:https://github.com/git/git/releases - 移除系统自带git
yum remove git
- 下载git软件包并解压
wget https://www.kernel.org/pub/software/scm/git/git-2.11.3.tar.gz tar -zxvf git-2.11.3.tar.gz
- 编译安装,如果有依赖软件,根据提示安装即可
cd git-2.11.3 make configure ./configure --prefix=/usr/local/git #配置安装目录 make profix=/usr/git make install
- 添加环境变量
echo "export PATH=$PATH:/usr/git/bin" >> /etc/profile source /etc/profile
- 查看git 版本检查是否安装成功
git --version
网友评论