经过本人在阿里云服务器上实际总结:
第一步:安装linux环境git依赖包
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
第二步:下载git安装包
两种方式:
1.官方:yum install git(注:官方地址https://git-scm.com/download/linux)
2.wget https://www.kernel.org/pub/software/scm/git/git-2.8.3.tar.gz
第三步:解压tar,编译安装
[root@Git ~]# cd git-2.8.3
[root@Git ~]# make configure
[root@Git ~]# ./configure --prefix=/usr/git ##配置目录
[root@Git ~]# make profix=/usr/git
[root@Git ~]# make install
第四步: 加入环境变量
[root@Git ~]# echo "export PATH=$PATH:/usr/git/bin" >> /etc/profile
[root@Git ~]# source /etc/profile
第五步:完成-检查版本
如果出现错误:
yum install cpp
yum install binutils
yum install glibc
yum install glibc-kernheaders
yum in