Linux git版本升级

382 words

准备工作

  1. 删除旧版本

    1
    2
    yum remove git
    git --version
  2. 安装需求

    1
    yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
  3. 下载新版本

    1
    wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz

安装

  1. 编译

    1
    2
    3
    4
    tar -zxf git-2.9.5.tar.gz
    cd git-2.9.5
    make prefix=/usr/local/git all
    make prefix=/usr/local/git install
  2. 添加环境变量

    1
    2
    3
    vim /etc/profile
    export PATH=$PATH:/usr/local/git/bin
    source /etc/profile
  3. 查看版本

    1
    git --version
Comments