Skip to content

Instantly share code, notes, and snippets.

@matthewriley
Last active July 26, 2017 16:19
Show Gist options
  • Save matthewriley/bc623525b6b97f4fdf4b11f0f4c1515f to your computer and use it in GitHub Desktop.
Save matthewriley/bc623525b6b97f4fdf4b11f0f4c1515f to your computer and use it in GitHub Desktop.

Install Git 2.13.3 from source on RHEL 7.x

These are the Terminal commands I recently used (July 2017) to install Git 2.13.3 from source on RHEL 7.x. I ran this in a VirtualBox VM after a fresh install from the ISO.

You mileage will vary as the yum packages are updated over time. The yum install line below should include all the dependencies, at least it did for me. Depending upon how often you use yum update you may need to run yum --enablerepo=base clean metadata as su before you run the following commands.

cd ~/Downloads
su
# First remove old system git
yum erase git
# Next install dependencies
yum install autoconf cpio curl-devel expat-devel gcc make openssl-devel perl-ExtUtils-MakeMaker zlib-devel
# Lastly download, compile and install git from source
wget -O v2.13.3.tar.gz https://github.com/git/git/archive/v2.13.3.tar.gz
tar -xzvf ./v2.13.3.tar.gz && cd git-2.13.3/
make configure && ./configure --prefix=/usr/local/git
make && make install
ln -sv /usr/local/git/bin/* /usr/bin/
exit

At this point you can safely remove the git tar file and git directory from your Downloads directory. Git should now be configured according to the following:

$ which git
/usr/bin/git

$ git --version
git version 2.13.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment