The git version that yum installs on Centos is quite old. I will go through installing the latest version of Git on Centos 7 from the source code.
Environment:
- OS: Centos 7.3
- Git that comes with yum: 1.8
- Current latest git: 2.12
Install Dependencies
sudo yum -y updatesudo yum groupinstall "Development Tools" sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel
Download latest package
cd /opt/ sudo wget https://github.com/git/git/archive/v2.12.2.tar.gz\ -Ogit-2.12.2.tar.gzsudo tar -zxf v2.12.2.tar.gz cd git-2.12.2/sudo make configuresudo ./configure --prefix=/usr/localsudo make install

You could have labelled or listed the commands correctly in ORDER …..