Skip to content

Instantly share code, notes, and snippets.

@rahilwazir
Forked from eyecatchup/mkgit-centos6.sh
Last active March 15, 2017 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahilwazir/56e9e29777e7ecf2ad75184261dda0ba to your computer and use it in GitHub Desktop.
Save rahilwazir/56e9e29777e7ecf2ad75184261dda0ba 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.9.3.tar.gz
sudo tar xzf git-2.9.3.tar.gz
cd git-2.9.3
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment