How to install Git and the latest version on CentOS 6.x/7.x

Source: Internet
Author: User

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

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.