Mode one, yum installation
# yum Install git
installed through the Yum mode, version is older, CentOS6.5 installed on the 1.7.1 version. If you want to install the latest version or other version, you need to use the source code to compile the installation method.
Mode two, source package installation
Step 1. Install dependent packages
# yum Install curl-devel expat-devel gettext-devel openssl-devel zlib-devel# yum install gcc Perl-extutils-makemaker
Step 2. Uninstall the old git version (if you have previously installed RPM packages)
# yum Remove git
Step 3. Download & Unzip
# cd/usr/src# wget https://www.kernel.org/pub/software/scm/git/git-2.5.0.tar.gz# tar-zxvf git-2.5.0.tar.gz
or # wget https://github.com/git/git/archive/v2.5.0.tar.gz Download
Step 4. Compiling the installation
# CD git-2.5.0# make prefix=/usr/local/git all# make Prefix=/usr/local/git install# echo "Export path= $PATH:/usr/local/gi T/bin ">>/etc/bashrc# SOURCE/ETC/BASHRC
Step 5. Check git version
# git--versiongit version 2.5.0
Reference: Http://stackoverflow.com/questions/21820715/how-to-install-latest-version-of-git-on-centos-6-x-7-x
How to install Git and the latest version on CentOS 6.x/7.x