CentOS upgrade Git

Source: Internet
Author: User

The current version of Git (when I wrote this article) is 1.7.12. However, the Git version of CentOS is 1.7.1, and the highest version of Git installed with yum is 1.7.1, of course, if you haven't encountered any problems at work, there is certainly no problem with using this version, but if you encounter a task that is only supported by a later version of Git at work, how can we upgrade Git? In fact, GitHub and many Git services depend on a Git version no less than 1.7.2. Next we will take the CentOS-6.5 as an example to illustrate how to upgrade our Git.
1. Install the certificate using the powerful functions of rpm. Import the required certificate from the address below. The command is as follows:

# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

Ii. What is the RPMForge source installed? RPMForge is a software warehouse under the CentOS system and has more than 4000 software packages. It is considered by the CentOS community as the safest and most stable software warehouse. While CentOS comes with CentOS-Base.repo source by default, but the official source to remove a lot of copyrighted software, and the installation of software is not the latest stable version. So here we use this rpm software repository. The address is as follows: http://rpmfusion.org
Because Git of different CentOS versions has different rpm packages, you can find the RPMForge suitable for your system installation on this website when downloading and installing RPMForge. The address is as follows:
Http://pkgs.repoforge.org/rpmforge-release/
Since my CentOS is a CentOS-6.5 32-bit, my corresponding rpm installation package is: rpmforge-release-0.5.3-1.el6.rf.i686.rpm, so you can install it with the following command:
# rpm -i http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
With the online installation function of rpm, we can directly install it online without downloading the rpm package.
3. Use the rpmforge-extra source to update the software. Because the software downloaded by the yum command depends on the software warehouse in use, we only need to change the specified software warehouse, you can use yum to conveniently download and install the software in the RPMForge source to update the software on the local machine, thus simplifying the installation operation. The command is as follows:
# yum --enablerepo=rpmforge-extras update
You will see that there will be a large number of software updates due to the switching of the software warehouse, you can choose to install or not install. If you choose to install, enter 'y'. After the installation is complete, Git is changed to the latest version. However, because there are too many software to be updated, you can install only Git and enter 'n '.
Note: The above command is actually the same as yum update, but the above command specifies that the software warehouse for update comparison is RPMForge. After my observation, the option -- enablerepo = rpmforge-extras does not change the default software repository of yum, so this option is required every time you want to download software from. To keep using third-party sources, install the yum-priorities plug-in and configure the relevant file/etc/yum. repos. d/CentOS-Base.repo. (If there is any error, I hope to point it out)
4. Check the available git modules. because we do not know which versions of Git can be installed in our system, you can use the following command to check and select the latest version of git for installation. The command is as follows:
# yum --enablerepo=rpmforge-extras provides git
5. Install Git because we are using the RPMForge software repository, if you do not run the four-point command during installation, your system should choose which version to install, we can find the Git corresponding to our version in its repository, its address is as follows: http://pkgs.repoforge.org/git/
Because I am CentOS-6, so the latest is gitk-1.7.12.4-1.el6.rfx.i686.rpm.
The command is as follows:
# yum --enablerepo=rpmforge-extras install gitk-1.7.12.4-1.el6.rfx.i686.rpm
6. Check the version so far. Our Git has been upgraded and the old Git will be overwritten. You can run the following command to check the git version:
# git --version
Or
# rpm -q git

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.