linux安装git

工具

linux安装git。

  1. 安装git依赖包
    yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
  2. 删除已有的git
    yum remove git
  3. 进入到(cd /usr/src/local)目录,下载git安装包
    wget https://www.kernel.org/pub/software/scm/git/git-2.16.2.tar.gz
  4. 解压git安装包
    tar -zxvf git-2.16.2.tar.gz && cd git-2.16.2
  5. 配置git安装路径
    ./configure prefix=/usr/local/git/
  6. 编译并且安装
    make && make install
  7. 将git指令添加到bash中
    vi /etc/profile
    export PATH=$PATH:/usr/local/git/bin
  8. 让该配置文件立即生效
    source /etc/profile