Skip to content

Instantly share code, notes, and snippets.

@nhahv
Created December 6, 2017 17:21
Show Gist options
  • Save nhahv/7077a638b57f7d91ebe9a3c6caebbe4f to your computer and use it in GitHub Desktop.
Save nhahv/7077a638b57f7d91ebe9a3c6caebbe4f to your computer and use it in GitHub Desktop.
You can use WANDisco's CentOS repository to install Git 2.x

#Install Git2.x On Centos

  • Install WANDisco repo package:
yum install http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm
  • Install the latest version of Git 2.x:
yum install git
  • Verify the version of Git that was installed:
git --version

AIO

yum install -y http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm
yum install -y git
git --version
@saiful7
Copy link

saiful7 commented Nov 27, 2018

Just automated your Command with Centos 7 and 6.

#!/bin/bash

centosversion=`rpm -qa \*-release | grep -Ei "oracle|redhat|centos" | cut -d"-" -f3`
echo "######################################################################################################"
echo "CentOS $centosversion server detected, Git 2* will install and configre as per centos $centosversion"
echo "######################################################################################################"

if [ $centosversion -eq "6" ]; then
echo 
echo "# Git YUM repo installing as per Centos 6"
echo
yum install -y http://opensource.wandisco.com/centos/6/git/x86_64/wandisco-git-release-6-1.noarch.rpm
echo
echo "Congratulations Wandisco YUM repo installed Successfully on the system "
echo
echo "Now installing Git on $hostname server"
yum install git -y
yum update git -y
fi

if [ $centosversion -eq "7" ]; then
echo 
echo "# Git YUM repo installing as per Centos 7"
echo
yum install -y http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
echo
echo "Now installing Git on $hostname server"
yum install git -y
yum update git -y

fi 

clear

echo "GIT Latest version installed Successfully"
git --version

echo "Thanks :: Saiful Islam Rokon Akon"

exit 0

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