centos6 安装git工具

  • 可以采用安装开发工具包:
sudo yum groupinstall "Development Tools"
sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel

完成以上后,本地安装的git版本是1.7.1

  • 在以上的基础上,可以编辑指定的版本
wget https://github.com/git/git/archive/v2.1.2.tar.gz
tar -zxf git.tar.gz
cd git
make configure
./configure --prefix=/usr/local/git
#开始编译
sudo make install

将git加入环境

[root@localhost ~]# echo 'export PATH=$PATH:/usr/local/git/bin' >> /etc/bashrc
[root@localhost ~]# source /etc/bashrc

最后查看版本


整理自:
1.http://www.cnblogs.com/njl041x/p/6197244.html
2.http://www.cnblogs.com/007sx/p/6076151.html (含有搭建git服务的指导)
额外附上官方的教程:
https://github.com/git/git/blob/master/INSTALL

你可能感兴趣的:(centos6 安装git工具)