centos6.5安装git

安装git是因为vue-cli需要git去下载webpack这样的模板

1,     安装编译git时需要的包

 yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
 yum install  gcc perl-ExtUtils-MakeMaker

2, 删除已有的git .  
yum remove git

3, 下载git源码.

wget https://github.com/git/git/archive/v2.13.0.tar.gz

tar zxvf v2.13.0.tar.gz

我们可以从https://github.com/HYPERLINK "http://lib.csdn.net/base/git" \o "Git知识库" \t "_blank"Git/git/releases 查看最新版的,然后把wget后面的版本换成最新的

4, 编译安装

cd git-2.13.0make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc
PSmake prefix=/usr/local/git all这一步可能会报错如:Can't locate ExtUtils/MakeMaker.pm in @INC….解决方案:yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker  然后再重新执行make prefix=/usr/local/git all
5, 检查一下版本号
git --version
posted @ 2017-05-26 08:18  蚊子吃青蛙  阅读(131)  评论(0编辑  收藏  举报