travis.media

How to Upgrade Git on RHEL7 and CentOS7

Red Hat Enterprise Linux 7 (RHEL7) comes with git 1.8. And git 1.8 is old and unusable in most situations. So how you do upgrade it. Well, with this script of course.

Create a file:

touch gitupgrade.sh

And add the following to it:

yum -y remove git
yum -y clean packages
mkdir tempgit
cd tempgit
yum install -y autoconf cpio curl-devel expat-devel gcc gettext-devel make openssl-devel perl-ExtUtils-MakeMaker zlib-devel
wget -O v2.24.1.tar.gz https://github.com/git/git/archive/v2.24.1.tar.gz
tar -xzvf ./v2.24.1.tar.gz
cd git-2.24.1/
make configure
./configure --prefix=/usr/local/git
make && make install
ln -sf /usr/local/git/bin/* /usr/bin/
cd ..
rm -fr git-2.24.1
cd ..
rm -fr tempgit
echo "results"
which git
git --version

The run it to upgrade:

sudo sh gitupgrade.sh

And that’s a wrap

----------

** This article may contain affiliate links. Please read the affiliate disclaimer for more details.

About Me Author

Travis of

Travis Media

Who Am I? I was 34 years old in a job I hated when I decided to learn to code. Read More
Explore

You May Also Like