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 know very little about git or EGit. I installed EGit into Eclipse Indigo. I got a git path from someone who has some code in that repo. I tried to clone the repo. It failed with the following (name, host, and path elided):

Cannot list the available branches.
Reason:
myname@myhost:mypath: cannot execute:
git-upload-pack 'mypath'
bash: git-upload-pack: command not found

I then logged onto the box with Putty, using the same credentials and ran "which git-upload-pack", and it returned "/usr/local/bin/git-upload-pack".

share|improve this question

2 Answers 2

TL;DR – try to add the following to ~/.bashrc on your remote machine:

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

The issue probably is that the $PATH for your PuTTy connection and the Git connection is different.

So whenever you login over PuTTy, ~/.bash_profile is executed and sets your path correctly, whereas with Git, ~/.bashrc is executed and fails to set the path to your Git binary. Take a look at both ~/.bash_profile or ~/.profile, and ~/.bashrc for any statements like export PATH. My guess is that in the former one, the path to /usr/local/bin is set, whereas it is not in ~/.bashrc.

share|improve this answer

Never mind. I figured it out. It was executing my .bashrc directly, and I had put the /usr/local/bin path into my local.profile. Once I added /usr/local/bin to my .bashrc, it started working.

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.