CentOS7 安装最新版git教程

  1. 下载编译工具 
    yum -y groupinstall "Development Tools"

  2. 下载依赖包 
    yum -y install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel

  3. 下载 Git 最新版本的源代码 
    wget https://www.kernel.org/pub/software/scm/git/git-2.13.3.tar.gz 
    登录https://github.com/git/git/releases查看git的最新版。不要下载带有-rc的,因为它代表了一个候选发布版本。 

    4.解压 
        tar -zxvf git-2.11.0.tar.gz

    5、进入目录配置 
        cd git-2.13.3 
        ./configure --prefix=/usr/local/git

    6.安装 
        make && make install

    7.配置全局路径 
        export PATH="/usr/local/git/bin:$PATH" 
        source /etc/profile

    8.查看git版本 
        git --version

猜你喜欢

转载自blog.csdn.net/qq292913477/article/details/80703411