Installing git from source

RHEL7/CentOS7 use a relatively old version of git. Here’s how to update (using git 2.28.0 as example)

sudo yum -y install curl-devel
GITVERSION=2.28.0
mkdir -p ~/src && cd ~/src
git clone https://github.com/git/git
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-$GITVERSION.tar.gz
tar xf git-$GITVERSION.tar.gz
cd git-$GITVERSION && ./configure && make && sudo make install
git --version

Leave a Comment