系统环境:CentOS release 6.8 (Final)
默认Git :1.7.1
需求git :2.11
卸载centos自带的git:yum remove git -y
下载git-2.11.0.tar.gz 上传至服务器,下载链接:http://distfiles.macports.org/git/
解压安装git 并添加git到环境变量
cd /usr/local/src/ tar zxvf git-2.11.0.tar.gz make prefix=/usr/local/git all make prefix=/usr/local/git install 添加git到环境变量 echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc 或者 echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile source /etc/bashrc 或者 source /etc/profile
查看git版本号
[[email protected] git-2.11.0]# git --version git version 2.11.0
时间: 2024-10-29 10:46:54