操作系统是centos6.5,git版本是再带的V1.7.1(使用git --version 查看)
首先卸载旧版本git
yum remove git
直接使用这个命令下载的还是1.7.1版本的。不使用源码进行编译是因为依赖太多,总会缺东西。
yum install git
可以使用 WANDisco's CentOS repository去安装 Git 2.x.
1、Install WANDisco repo package:
yum install http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm
2、Install the latest version of Git 2.x:
yum install git
参考文章: