Git 2.8.x 安装和配置--Linux篇

阅读目录:

1. 简介

2. 关闭防火墙和Selinux

3. 下载并安装Git 2.8.x版本

4. 验证

5.说明

1. 简介

  • Git是一款免费、开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目。
  • Git是一个开源的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理。 Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。<!-- 百度百科 -->

2. 关闭防火墙和Selinux

        Linux的防火墙是咱们新手的噩梦,很多情况会出现能ping通,但是访问不了Web页面。所以开始就干掉它!

    2.1 关闭防火墙

    [root@localhost ~]# /etc/init.d/iptables stop
    iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
    iptables: Flushing firewall rules:                         [  OK  ]
    iptables: Unloading modules:                               [  OK  ]

    2.2 开机自动关闭防火墙

    [root@localhost ~]# chkconfig iptables off

    2.3 查看Selinux状态

    [root@localhost ~]# sestatus
    SELinux status: enabled 
    SELinuxfs mount: /sys/fs/selinux 
    SELinux root directory: /etc/selinux 
    Loaded policy name: targeted 
    Current mode: enforcing 
    Mode from config file: enforcing 
    Policy MLS status: enabled 
    Policy deny_unknown status: allowed 
    Max kernel policy version: 28

    2.4 关闭selinux

    [root@localhost ~]# vi /etc/selinux/config 

修改 SELINUX=disabled 
注:永久开启->改成:SELINUX=enforcing

3. 下载并安装Git 2.8.x版本

注:为了方便管理,创建一个文件夹专门放所需软件

    [root@localhost /]# mkdir developer
    [root@localhost /]# cd developer

    3.1 安装前的环境准备

    [root@localhost developer]# yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils- MakeMaker

    3.2 下载Git 2.8.x

    [root@localhost developer]# wget https://github.com/git/git/archive/v2.8.0.tar.gz

    3.3 解压Git 2.8.x

    [root@localhost developer]# tar -zxvf v2.8.0.tar.gz

    3.4 进入Git目录

    [root@localhost developer]# cd git-2.8.0

   3.5 编译到/usr/local目录下

    [root@localhost git-2.8.0]# make prefix=/usr/local/git all

    3.6 安装到/usr/local目录下

    [root@localhost git-2.8.0]# make prefix=/usr/local/git install

    3.7 配置Git的环境变量

    [root@localhost git-2.8.0]# vim /etc/profile

    在文本末最后一行添加如下代码:

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

保存退出。

   3.8 使配置立即生效

    [root@localhost git-2.8.0]# source /etc/profile

4. 验证

    验证Git是否成功

    [root@loubobooo git-2.8.0]# git --version
    git version 2.8.0

    出现Git版本号,便算成功。

    git version 2.8.0

5. 说明

    说明:本次使用

       操作系统:CentOS 6.8 64位

       Git版本:2.8.0

下一篇:Git使用细节--Windows篇:

        https://my.oschina.net/u/3209432/blog/1600785

转载于:https://my.oschina.net/loubobooo/blog/1600671

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值