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.
Bash script to install the latest Git version on CentOS 6.x.
#!/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
@stalinb01
Copy link

stalinb01 commented Jul 30, 2017

Thanks you very much!

@KBobovskiy
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment