centos6 git安装

  •   由于我的服务器 yum 源为1.7版本,我选择手动安装:

  git地址 :https://github.com/git/git/releases

  •   源码安装,安装依赖的包 

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

  • 下载git源码并解压 

  我选择的版本下载地址:https://github.com/git/git/archive/v2.12.5.tar.gz

 

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

  解压:

#tar zxvf v2.12.5.tar.gz 
#cd git-2.12.5

 

 

  • 编译安装 

  

  #make prefix=/usr/local/git all 
  #make prefix=/usr/local/git install

 

 

 

  • 配置环境变量 
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc

# source /etc/bashrc
使用source命令立即生效,不需要重启系统。

 

  • 查看git 
 # whereis git 
 # git version

 

posted @ 2017-10-17 18:10  RossKing  阅读(171)  评论(0编辑  收藏  举报