First check your version of CentOS:
$ cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
Now download a rpm package for Git from official mirror of CentOS in your home folder:
$ wget http://mirror.centos.org/centos/7/os/x86_64/Packages/git-1.8.3.1-23.el7_8.x86_64.rpm
Then execute, in your home:
rpm2cpio git-1.8.3.1-23.el7_8.x86_64.rpm | cpio -idm
Your git is installed in ~/usr/bin/
.
After update your ~/.bashrc
with:
...
# Git
export PATH="$HOME/usr/bin:$PATH"
export GIT_EXEC_PATH=$HOME/usr/libexec/git-core
Note: GIT_EXEC_PATH
allows to locate the relative git commands, see that with git --exec-path
Now you have your git installed and working for the current user.