7

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".

2 Answers 2

1

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.

0

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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