Steps to upgrade Centos 6.5 to Git2.1.2

Installation requirements

# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
# yum install  gcc perl-ExtUtils-MakeMaker

Uninstall git1.7.1 that comes with Centos

Check the version with the system through git –version, Cento6.5 should come with the git version 1.7.1

# yum remove git

Download git2.1.2 and add git to environment variables

Download the latest version of git

# cd /usr/src
# wget https://www.kernel.org/pub/software/scm/git/git-2.1.2.tar.gz
# tar xzf git-2.1.2.tar.gz

Install git and add to environment variables

# cd git-2.1.2
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc

View version number

# git --version
git version 2.1.2

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327067614&siteId=291194637