Skip to content

Instantly share code, notes, and snippets.

@eyecatchup
Created June 26, 2015 08:08
Show Gist options
  • Save eyecatchup/ccd23ad7e1154240d5d2 to your computer and use it in GitHub Desktop.
Save eyecatchup/ccd23ad7e1154240d5d2 to your computer and use it in GitHub Desktop.

Revisions

  1. eyecatchup created this gist Jun 26, 2015.
    25 changes: 25 additions & 0 deletions mkgit-centos6.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    #!/usr/bin/env bash
    # Install the latest version of git on CentOS 6.x

    # Install Required Packages
    sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
    sudo yum install gcc perl-ExtUtils-MakeMaker

    # Uninstall old Git RPM
    sudo yum remove git

    # Download and Compile Git Source
    cd /usr/src
    sudo wget https://www.kernel.org/pub/software/scm/git/git-2.4.4.tar.gz
    sudo tar xzf git-2.4.4.tar.gz

    cd git-2.4.4
    sudo make prefix=/usr/local/git all
    sudo make prefix=/usr/local/git install

    echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
    sudo ln -s /usr/local/git/bin/git /usr/bin/git
    source /etc/bashrc

    # Check Git Version
    git --version