Updating Git on CentOS 6

Recently I had an issue with Pycharm, awesome software totally worth the investment by the way, where it was complaining about my version of Git. Took a bit of hacking around but I finally figured out my solution.

As of this writing, CentOS 6 has a default git version of 1.7.1.  This version is what you will have installed if you run the typical install command:

# yum install git

I needed to have at least version for Pycharm to properly work. Found this quick fix online. You need to do this from a root account, but then the process is easy!

Add RPM Forge to Yum Repos

wget 'http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm'
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -i 'rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm'
yum clean all

Install New Version from RPM Forge

cd /etc/yum.repos.d
vim (or whatever) rpmforge.repo

change the enabled=0 flag to enabled=1 in the section labelled [rpmforge-extras].

yum  update
yum provides git

This will return a longer list of available git modules.

Install the newer git by copying the FULL REPO NAME.   For example:

yum install git-
git --version

You should have the new release installed.

Now go back and edit rpmforge.repo and disable the rpmforge-extras repository.  Then ensure the yum directory is cleaned up.

yum update

When you are done, feel free to disable the rpmforge-extras back to 0. I personally would do this to ensure you have CentOS specific releases outside of RPMforge.