Install the latest version of Git on centos 6.x

Source: Internet
Author: User

Git is available in the default repository of centos, so the simplest method is:

$ sudo yum install git

 

This method is simple, but the version updates in the repository are not timely. For example, the latest version of git in the centos repository is 1.7.1 (today is), but git is officially available in version 2.x.

In this case, you have to use the final kill and compile the source code to install it.

The procedure is as follows:
1. download and install the compilation tool for centos.

$ sudo yum groupinstall “Development Tools”

 

2. install other Dependencies required for git build or execution.

$ sudo yum install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel

 

3. Download the source code of the latest version of git.

$ cd ~$ wget -O git.zip https://github.com/git/git/archive/master.zip

 

4. decompress the source file

$ unzip git.zip$ cd git-master


5. Build and install

$ autoconf$ ./configure$ make && make install


6. Create a link

$ ln -s /usr/local/bin/git /usr/bin/


If the old version has been installed in the system, step 6 May report an error in the file. In this case, delete the old link and re-link it.

7. Check the GIT version

$ git --version


The latest version of git should be displayed.

Install the latest version of Git on centos 6.x

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.