(1)執(zhí)行命令:yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
(2)卸載舊版本git: yum remove git
(3)下載git: wget https://github.com/git/git/archive/v2.16.2.tar.gz
(4)解壓:tar xzf git-1.9.0.tar.gz
(5)進入解壓后的git安裝目錄:cd git-xxx
(6)編譯:make prefix=/usr/local/git all
(7)安裝:make prefix=/usr/local/git install
(8)編輯環(huán)境變量配置(給到所有用戶):vim /etc/profile
(9)profile文件末尾追加:export PATH=$PATH:/usr/local/git/bin
(10)刷新配置:source /etc/profile
(11)查看版本:git —version