The first step, download the source code files
wget https://github.com/git/git/archive/v2.21.0.tar.gz
The second step, installing its dependencies
sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
sudo yum install openssl-devel gettext asciidoc xmlto docbook2x
The third step is to compile and install
tar -zxvf git-2.21.0.tar.gz
cd git-2.21.0
make configure
./configure --prefix=/usr
make all doc
make install install-doc install-html