Created
June 26, 2015 08:08
-
-
Save eyecatchup/ccd23ad7e1154240d5d2 to your computer and use it in GitHub Desktop.
Bash script to install the latest Git version on CentOS 6.x.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!