CentOS6.7 install the latest git
1. Install the compiling environment
# yum -y install gcc zlib-devel openssl-devel perl cpio expat-devel gettext-devel curl perl-ExtUtils-MakeMaker asciidoc xmlto
2. download the latest git package
Git latest package: http://codemonkey.org.uk/projects/git-snapshots/git/
Run the following command to download the latest git package:
# wget -c http://codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.xz
3. decompress the git package
# xz -d git-latest.tar.xz# tar -xvf git-latest.tar
4. Compile and install git
# Cd git-2016-05-24 # autoconf #./configure # make & make install (or make-jn & make-jn install)
Here, n in make-jn is the specified number of threads. For multi-core processors, this can speed up compilation and installation.
5. Create a git soft link
# ln -s /usr/local/bin/git /usr/bin/
Because the original centos comes with git,/usr/bin/git already exists. Delete it and recreate it as follows:
# rm -fr /usr/bin/git# ln -s /usr/local/bin/git /usr/bin/
6. Check the version number.
# git --versiongit version 2.9.0-rc0