How can I configure yum to use some repository which has git rpms?
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
For a more up-to-date version of Git (188.8.131.52 at the time of this writing versus 184.108.40.206 in the EPEL repository), see Andrew Thompson's Webtatic repository:
Elaborating @Cristian Ciupitu answer it would be possible to do it via yum.repos.d:
Go to https://fedoraproject.org/keys and install the
RPM-GPG-KEY-EPELpublic key by downloading its contents into the
RPM-GPG-KEY-EPELfile and running
rpm --import RPM-GPG-KEY-EPEL.
Create a file
rhel-epel.repo(choose any name you want) in
Add following content:
[rhel-epel] name=Extra Packages for Enterprise Linux $releasever - $basearch baseurl=http://download3.fedora.redhat.com/pub/epel/$releasever/$basearch enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
yum install git.