Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Centos server that I tried to yum install git and git-core and all that and I just consistently got the error message that the git package wasn't found. So I installed it from source following all the instructions over at O'reilly.

When I ran all the commands, the screen looked appropriately busy and the verbose dialog pointed to the fact that an installation occurred in usr/local/bin...but when I run git from the command line or git --help, I get nothing. bash doesn't recognize it.

And why didn't yum find it and just save me the pain of the source install in the first place? Git and access control stuff has now occupied three weeks of my life I can never git back....

share|improve this question

migrated from stackoverflow.com Jun 27 '11 at 14:22

This question came from our site for professional and enthusiast programmers.

    
Is /usr/local/bin on your path? Did you try any repo other than the central CentOS one? –  larsmans Mar 29 '11 at 23:00
    
Yes, it was on my path. I'm new to Centos. Wasn't sure what alternatives there were. –  Lynn Mar 29 '11 at 23:11

4 Answers 4

up vote 1 down vote accepted

Ok, it was not the path. I installed the source of git logged in as root. For some reason git would not run under root. When I exited from root and ran it again, it ran. Go figure. I'm still trying to figure out the world of permissions and access control. I don't understand why it won't run under root, but there it is. It would be awesome if someday Centos could add the git package to yum and make it slightly less painful.

share|improve this answer
    
So it wasn't on your path as root? –  larsmans Mar 29 '11 at 23:13
    
superuser.com/questions/184228/installing-git-on-centos seems to imply that you can install git via yum just fine. –  CanSpice Mar 29 '11 at 23:28
    
ok. you were right. that's where my confusion was. I didn't know the PATH var could change from user to user (hey I'm a developer not a sys admin...though I'm both now whether I like it or not). –  Lynn Mar 29 '11 at 23:31
    
And for other unfortunate souls who are looking for how I solved THAT part of the most painful git install of the day was went to root again and put this on the command line: export PATH=$PATH:/usr/local/bin Made me just wish I was on Debian where apt-get install takes care of this @#$@. –  Lynn Mar 29 '11 at 23:33
    
canSpice - I know. I read it in a dozen places all over the internet that you can. I was greeted each and every time by the package not recognized or found message. And yes, before you ask, yum was installed. I use it a lot. –  Lynn Mar 30 '11 at 0:32

Presumably /usr/local/bin isn't on your path -- add it (probably by editing ~/.bashrc.)

share|improve this answer
    
it is on my path... –  Lynn Mar 29 '11 at 23:01

This belongs on serverfault, however, some linux systems already have a package called 'git', which predates Linus's version control thing, and is infact completely unrelated.

Do make sure that the "git" you're trying to install is the git you actually want.

share|improve this answer
    
Ok sorry. Didn't really know about serverfault until recently actually. –  Lynn Mar 29 '11 at 23:37
    
@Lynn: Feel free to add a link to the relevant issue or vote to close it, eitherway, lets not have unanswered questions. –  Arafangion Mar 30 '11 at 3:16

Some advise, which is related to your question:

Don't compile from source unless you really have to, any other package that you want to install from now on will not know that git "is installed". For RHEL/CentOS git is available from the EPEL repository pre. 6 (for 6 I think it's now in base).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.