Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I made a git repo on a local machine with "git init --bare" and added it as the remote origin on the project on my main computer with ssh:

git add remote origin git@192.168.1.14:repoName.git

I was able to make a commit and push from my main computer to the other computer the day I created the repo, but today i tried and it didn't work.

When I did "git push origin" it returned this error:

bash: line 1: git-receive-pack: command not found
fatal: The remote end hung up unexpectedly

The two machines are mac the main one running Leopard and the server one running Tiger. I think it may be realted to the $PATH of git on the server but I'm not sure.

i used theses instrution to create my git server: http://blog.commonthread.com/2008/4/14/setting-up-a-git-server

share|improve this question
add comment

3 Answers

up vote 7 down vote accepted

Ok, so I solved my problem.

I looks like the probleme was ssh not reading .bash_profile What I had to do is write

export PATH=$PATH:/usr/local/bin

in .bashrc instead since ssh reads that file.

share|improve this answer
    
Same applies for OpenIndiana (and most likely other unixes). Placing PATH definition in .bashrc works for git push over ssh. –  Matt Connolly May 1 '11 at 10:42
add comment

You need to use /etc/rc.common instead ~/.bashrc to solve these problem for all users and all shells on your server

share|improve this answer
add comment

The standard installation of Git on OS X puts git in /usr/local/git/bin

The .bashrc path statement should look like

export PATH=$PATH:/usr/local/git/bin
share|improve this answer
add comment

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.