zoukankan      html  css  js  c++  java
  • linux下升级git版本的操作记录(摘录)

    在使用git pull、git push、git clone的时候,或者在使用jenkins发版的时候,可能会报类似如下的错误: error: The requested URL returned error: 401 Unauthorized while accessing https://git.oschina.net/zemo/demo.git/info/refs fatal: HTTP request failed

    这个一般是由于服务器本身自带的git版本过低造成的:

    [root@uatjenkins01 ~]# git --version
    git version 1.7.1

    一般只需要将git版本升级到高版本即可。下面说下git升级的操作记录:

    0)安装依赖软件
    [root@uatjenkins01 ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
    [root@uatjenkins01 ~]# yum install  gcc perl-ExtUtils-MakeMaker 
    
    1)卸载系统自带的底版本git(1.7.1)
    [root@uatjenkins01 ~]# git --version
    git version 1.7.1
    [root@uatjenkins01 ~]# yum remove git
     
    2)编译安装最新的git版本
    [root@uatjenkins01 ~]# cd /usr/local/src/
    [root@uatjenkins01 src]# wget https://www.kernel.org/pub/software/scm/git/git-2.15.1.tar.xz
    [root@uatjenkins01 src]# tar -vxf git-2.15.1.tar.xz
    [root@uatjenkins01 src]# cd git-2.15.1
    [root@uatjenkins01 git-2.15.1]# make prefix=/usr/local/git all
    [root@uatjenkins01 git-2.15.1]# make prefix=/usr/local/git install
    [root@uatjenkins01 git-2.15.1]# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
    [root@uatjenkins01 git-2.15.1]# source /etc/profile
     
    [root@uatjenkins01 ~]# git --version
    git version 2.15.1
     
    ======================================================================
    如果是非root用户使用git,则需要配置下该用户下的环境变量
    [app@uatjenkins01 ~]$ echo "export PATH=$PATH:/usr/local/git/bin" >> ~/.bashrc
    [app@uatjenkins01 ~]$ source ~/.bashrc
    [app@uatjenkins01 ~]$ git --version
    git version 2.15.1

    摘自:https://cloud.tencent.com/developer/article/1027571?from=information.detail.linux%E5%8D%87%E7%BA%A7git%E7%89%88%E6%9C%AC

  • 相关阅读:
    第13章 使用ADO.NET访问数据库
    第11章 连接查询和分组查询
    第10章 模糊查询和聚合函数
    第9章 数据查询基础
    数据库前三章测试题
    用表组织数据
    程序数据集散地:数据库
    深入C#的String类
    线程池
    hadoop-2.8.0 完全分布式运行模式
  • 原文地址:https://www.cnblogs.com/Denny_Yang/p/14212396.html
Copyright © 2011-2022 走看看