yum -y updategit
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMakergithub
$ wget https://github.com/git/git/archive/v2.3.0.zipvim
$ unzip v2.3.0.zipbash
$ cd git-2.3.0curl
将其安装在“/usr/local/git”目录下。url
make prefix=/usr/local/git all3d
make prefix=/usr/local/git installblog
你能够用下面的命令查看git所在的路径:ip
$ whereis gitssl
git: /usr/bin/git /usr/local/git /usr/share/man/man1/git.1.gz
vim /etc/profile
而后在文件的最后一行,添加下面的内容,而后保存退出。
export PATH=/usr/local/git/bin:$PATH
source /etc/profile