Use the EPEL (Extra Packages for Enterprise Linux) repository. The easiest way to enable it is by installing the epel-release
package. Here’s how if you have RHEL 5 x86_64:
[root@localhost]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
[root@localhost]# yum install git