centos 安装git

作者: yangxiaoming | 来源:发表于2017-07-07 18:57 被阅读39次
    1. 先卸载旧的git
      yum remove git
    2. 安装依赖包
      yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
      yum install gcc perl-ExtUtils-MakeMaker
    3. 下载并解压(当前版本2.9.4)
      cd /usr/src
      wget https://www.kernel.org/pub/software/scm/git/git-2.9.4.tar.gz
      tar -zxvf git-2.9.4.tar.gz
    4. 编译安装设置环境变量
      cd git-2.9.4
      make prefix=/usr/local/git all
      make prefix=/usr/local/git install
      echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
      source /etc/bashrc
    5. 检查版本
      git --version

    相关文章

      网友评论

        本文标题:centos 安装git

        本文链接:https://www.haomeiwen.com/subject/oysrhxtx.html