美文网首页系统支撑
centos7.4git安装

centos7.4git安装

作者: 打不死的小强8号 | 来源:发表于2018-11-04 10:10 被阅读0次

Contents

Body

CentOS 7.4 系统安装 git

CentOS下面安装git的命令

一、使用yum安装

1、****查看系统是否已经安装****git

[root@localhost ~]# git --version

2、CentOS6.5 yum ****安装****git

[root@localhost ~]# yum install git

3、****安装成功

[root@localhost ~]# git version
git version 1.7.1

[root@localhost ~]# git --version

git version 1.7.1

4、****卸载****git

[root@localhost ~]# yum remove git

二、源代码安装

在Linux下安装Git

Git是一个开源的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理。而国外的GitHub和国内的Coding都是项目的托管平台。但是在使用Git工具的时候,第一步要学会如何安装git,本教程就手把手教大家如何手动编译安装git。

1****、介绍

使用Coding管理项目,上面要求使用的git版本为1.8.0以上,而很多yum源上自动安装的git版本为1.7,所以需要掌握手动编译安装git方法。

2****、安装****git****依赖包

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

3****、删除已有的****git

  yum remove git

4****、下载****git****源码

  4.1、切换到你的包文件存放目录下

    cd /usr/src

  4.2、下载****git****安装包

    wget [https://www.kernel.org/pub/software/scm/git/git-2.8.3.tar.gz](https://www.kernel.org/pub/software/scm/git/git-2.8.3.tar.gz) --no-check-certificate

  4.3、解压****git****安装包 并进入到目录

    tar -zxvf git-2.8.3.tar.gz
    cd git-2.8.3

  4.4、配置git安装路径

    ./configure prefix=/usr/local/git/

  4.5、编译并且安装

    make && make install

5****、将****git****指令添加到****bash****中

  vi /etc/profile

在最后一行加入

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

image.png

让该配置文件立即生效

  source /etc/profile

6****、查看git版本号

  [root@localhost ~]# git version
  git version 2.8.3

git已经安装完毕
转载自 CentOS 7.4 系统安装 git

相关文章

网友评论

    本文标题:centos7.4git安装

    本文链接:https://www.haomeiwen.com/subject/htrrxqtx.html