背景

原生Centos7系统的yum源自带git版本是1.8.3.1。

这个版本诞生于:10-Jun-2013。

很多新特性都不支持,为了更好的使用git,我们需要进行版本升级。

源码编译安装

  1. 安装相关依赖
    1
    2
    # yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
    # yum install gcc perl-ExtUtils-MakeMaker
  2. 卸载当前git
    1
    # yum remove git
  3. 下载新版本源码包
    1
    2
    3
    4
    官方仓库地址:https://mirrors.edge.kernel.org/pub/software/scm/git/
    当前最新版本:git-2.28.0.tar.xz 27-Jul-2020

    # wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.28.0.tar.xz
  4. 源码编译安装
    1
    2
    3
    4
    5
    6
    7
    8
    # tar -xvf git-2.28.0.tar.xz
    # cd git-2.28.0/
    # which openssl 获取本机openssl路径,当前机器/usr/bin/openssl
    # ./configure --with-openssl=/usr/bin/openssl
    # make prefix=/usr/local/git all
    # make prefix=/usr/local/git install
    # echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
    # source /etc/profile

Comment and share

  • page 1 of 1
Author's picture

Weilong

    Write something about work-life:

PM


Shenzhen