centos 更新git

[root@1 ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
[root@1 ~]# yum install  gcc perl-ExtUtils-MakeMaker

1)卸载系统自带的底版本git(1.7.1)
[root@localhost ~] git --version
git version 1.7.1
[root@localhost ~] yum remove git

2)编译安装最新的git版本
[root@localhost ~] cd /usr/local/src/
[root@localhost src] wget https://www.kernel.org/pub/software/scm/git/git-2.15.1.tar.xz
[root@localhost src] tar -vxf git-2.15.1.tar.xz
[root@localhost src] cd git-2.15.1
[root@localhost git-2.15.1] make prefix=/usr/local/git all
[root@localhost git-2.15.1] make prefix=/usr/local/git install
[root@localhost git-2.15.1] echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
[root@localhost git-2.15.1] source /etc/profile

[root@localhost ~] git --version
git version 2.15.1
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容