Install git on CentOS

Hi Guys,

There is supposed to be a yum package for it, but it doesn't show up in the list of packages. I tried compiling from source, but it didn't work.

Do I just need to specify a different repository or something? Is there any way to easily get git on my linode?

Thanks

~sean

4 Replies

Adding this Repo : http://dag.wieers.com/rpm/ to Yum will give you easy access to a lot of popular rpm's including git :)

Thanks Navi,

I tried adding the repo, but I'm pretty new to this whole thing …so… I created a .repo file in /etc/yum.repos.d, but the existing repos in there have more information than you've given me. Or can I just use the --enablerepo flag with the full url you included?

Anyway, the build instructions at this url worked

http://linux.yyz.us/git-howto.html

Just found an article that has all the info for the dag repository

http://zilkey.com/2008/3/5/installing-g … centos-4-4">http://zilkey.com/2008/3/5/installing-git-on-railsmachine-centos-4-4

These are comments I made to myself for installing rpmforge repository on my Centos machines. Covers both centos4 and centos5

http://wiki.centos.org/Repositories/RPMForge

Centos4: yum –enablerepo=extras install yum-plugin-priorities

Centos5: yum install yum-priorities

Make sure that yum-priorities is enabled by editing the

/etc/yum/pluginconf.d/priorities.conf

file, and ensuring that it contains the following lines:

[main]

enabled=1

(this should be the default)

rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

wget http://apt.sw.be/redhat/el5/en/i386/RPM … f.i386.rpm">http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

wget http://apt.sw.be/redhat/el4/en/i386/RPM … f.i386.rpm">http://apt.sw.be/redhat/el4/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el4.rf.i386.rpm

rpm -K rpmforge-release-0.3.6-1.el5.rf.i386.rpm

(check signature)

rpm -i rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Edit the .repo files in /etc/yum.repos.d/ and set up priorities by adding

the line:

priority=N

to a repository entry, where N is an integer number from 1 to 99.

The recommended settings are:

[base], [addons], [updates], [extras] … priority=1

[centosplus],[contrib] … priority=2

Third Party Repos such as rpmforge … priority=N

(where N is > 10 and based on your preference)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct