美文网首页
CentOS6.5下安装Git

CentOS6.5下安装Git

作者: GREG蓝天 | 来源:发表于2019-01-08 10:27 被阅读0次

    一.安装git

    1.下载git-2.15.1.tar.gz

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

    2.解压

    tar -xvf git-2.15.1.tar.gz
    
    cd git-2.15.1
    

    3.安装gcc(用来编译git)

    sudo yum install gcc
    

    4.安装openssl

    yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
    

    5.编译和安装git到/usr/local/git

    make prefix=/usr/local/git all
    
    make prefix=/usr/local/git install
    

    6.配置环境变量

    echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
    
    source /etc/profile
    

    7.查看结果

    git --version
    
    出现版本号则说明安装成功

    相关文章

      网友评论

          本文标题:CentOS6.5下安装Git

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