因爲centos中的源倉庫中git不是最新版本,須要進行源碼安裝。git
[root@iZm5e3d4r5i5ml889vh6esZ zh]# yum info git Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Installed Packages Name : git Arch : x86_64 Version : 1.8.3.1 Release : 13.el7 Size : 22 M Repo : installed From repo : base Summary : Fast Version Control System URL : http://git-scm.com/ License : GPLv2 Description : Git is a fast, scalable, distributed revision control system with an : unusually rich command set that provides both high-level operations : and full access to internals. : : The git rpm installs the core tools with minimal dependencies. To : install all git packages, including tools for integrating with other : SCMs, install the git-all meta-package.
[root@iZm5e3d4r5i5ml889vh6esZ zh]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel [root@iZm5e3d4r5i5ml889vh6esZ zh]# yum install gcc perl-ExtUtils-MakeMaker
[root@iZm5e3d4r5i5ml889vh6esZ zh]# yum remove git
下載地址:https://github.com/git/git/releasesgithub
wget https://github.com/git/git/archive/v2.17.1.tar.gz
解壓、安裝vim
[root@iZm5e3d4r5i5ml889vh6esZ git]# tar zxvf v2.17.1.tar.gz [root@iZm5e3d4r5i5ml889vh6esZ git]# cd git-2.17.1/ [root@iZm5e3d4r5i5ml889vh6esZ git]# make prefix=/usr/local/git all [root@iZm5e3d4r5i5ml889vh6esZ git]# make prefix=/usr/local/git install
[root@iZm5e3d4r5i5ml889vh6esZ git]# vim /etc/profile export GIT_HOME=/usr/local/git export PATH=$GIT_HOME/bin:$PATH [root@iZm5e3d4r5i5ml889vh6esZ git]# source /etc/profile
[root@iZm5e3d4r5i5ml889vh6esZ git]# git --version git version 2.17.1