码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS 安装 Git

时间:2018-04-06 16:43:48      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:post   gpo   class   move   版本   下载   tar.gz   local   5.0   

安装前准备

删除旧版本:

1 yum remove git

安装依赖:

1 yum install curl-devel expat-devel openssl-devel zlib-devel

 

下载并安装

1 wget https://github.com/git/git/archive/v2.15.0.tar.gz
2 tar -zxf v2.15.0.tar.gz
3 cd git-2.15.0
1 autoconf                                           #通过configure.ac生成configure
2 ./configure prefix=/usr/local/git/                 #生成Makefile,指定安装路径
3 make                                               #编译
4 make install                                       #安装

 

将git命令添加到bash中

1 vim /etc/profile

在最后一行加入:

1 export PATH=$PATH:/usr/local/git/bin

刷新profile:

1 source /etc/profile

 

CentOS 安装 Git

标签:post   gpo   class   move   版本   下载   tar.gz   local   5.0   

原文地址:https://www.cnblogs.com/darknebula/p/8727955.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!