Look at https://github.com/git/git/tags and toward the top pick a recent version. (e.g. at the time of this edit, v2.31.1)
GITVER=2.31.1
wget https://github.com/git/git/archive/refs/tags/v${GITVER}.tar.gz
tar xf v${GITVER}.tar.gz
cd git-${GITVER}/
Assuming you already have an earlier version of git installed, a more recent version can be pulled from GitHub, using a shallow clone/checkout of the tag.
mkdir src-git
cd src-git/
git init
git remote add origin "https://github.com/git/git.git"
git fetch --depth 1 origin tag v2.31.1
git checkout tags/v2.31.1
yum groupinstall 'Development Tools'
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-CPAN perl-devel
make configure
./configure --prefix=/usr/local --with-python=`which python3`
PYTHON_PATH=`which python3` NO_TCLTK=1 make all
sudo make install
The building shouldn't be done as root.
So, execute
make
first, thensudo make install
.