Skip to content

Instantly share code, notes, and snippets.

@fivesmallq
Forked from eyecatchup/mkgit-centos6.sh
Last active September 19, 2017 10:55
Show Gist options
  • Save fivesmallq/efdd7bdf5c8d1602f8e12af40802aa1f to your computer and use it in GitHub Desktop.
Save fivesmallq/efdd7bdf5c8d1602f8e12af40802aa1f 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
#!/usr/bin/env bash
# https://github.com/git-lfs/git-lfs/wiki/Installation
# Install the IUS Community repo.
curl -s https://setup.ius.io/ | sudo bash
sudo yum install git2u
# download git lfs rpm
wget https://packagecloud.io/github/git-lfs/packages/el/6/git-lfs-2.3.0-1.el6.x86_64.rpm/download
mv download git-lfs-2.3.0-1.el6.x86_64.rpm
rpm -ivh git-lfs-2.3.0-1.el6.x86_64.rpm
git lfs install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment