Git安装——linux环境

1、查询git版本
    (1)查看git版本
              git --version
    (2)如果是1.8.3.1,则是centos默认的git版本,需要先卸载
              yum -y remove git
    (3)查看git版本,此时应该已经没有git版本了
              git --version
2、安装新版本git

   (1)安装依赖(如果有依赖,则此步骤跳过)
             yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
             yum install gcc-c++ perl-ExtUtils-MakeMaker

             安装完依赖需要重新查询当前git版本,如果有则删除(即重复步骤 1)
    (2)下载与安装(git版本可以去官网查看最新稳定版本)
             cd /var/local/download
             wget https://www.kernel.org/pub/software/scm/git/git-2.28.0.tar.gz
             tar -zxvf git-2.28.0.tar.gz
             mv git-2.28.0.tar.gz ../software
    (3)配置编译安装
             cd git-2.28.0/
             make configure
             ./configure --prefix=/usr/local/git
             make profix=/usr/local/git
             make install

             备注:
                  (1)执行 make configure 提示(/bin/sh: autoconf: command not found)
                            yum install install autoconf automake libtool

    (4)环境变量
              vim /etc/profile
              export PATH=$PATH:/usr/local/git/bin
              source /etc/profile
    (5)查看git版本
              git --version

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值