Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .