git-upload-pack: command not found

2,116 views
Skip to first unread message

Stephen Gariepy

unread,
Jul 31, 2010, 12:32:56 AM7/31/10
to msy...@googlegroups.com
I know this error pops up, and people seem to be able to fix it, but
after trying the upteenth solution I'm starting to consider myself
stuck, and I was hoping for a push in the right direction.

I have installed msysgit on windows XP in c:/program files/git. I am
trying to connect to my server at bluehost.com via ssh. I am trying to
do the inital clone of that repository on the bluehost linux server.

I'm currently typing in something like below and getting the error:
> git clone ssh://us...@domain.com/~/git/domain.git/
> Initialized empty Git repository in c:/xampp/htdocs/domain/.git
> us...@domain.com's password:
> bash: git-upload-pack: command not found
> fatal: The remote end hung up unexpectedly

I don't really know where git-upload-pack is supposed to be running
from, my computer or the server. I believe the server but at this
point I'm lost.

I've looked at the $PATH on the server and the git-core directory is
in it. I've run the command "ssh us...@domain.com "which
git-upload-pack" and got the answer "/bin:/usr/bin".

I've also tried typing in below and got this weird error:
> git clone -u /path/on/server/git-upload-pack ssh://us...@domain.com/~/git/domain.git
> Initialized empty Git repository in c:/xampp/htdocs/domain/.git/
> us...@domain.com's password:
> bash: C:/Program: No such file or directory
> fatal: The remote end hung up unexpectedly


All the commands that I've tried running are all from the Git BASH.
Git was installed with all the standard settings.

Can anyone please help me here, I've done my due diligence in trying
to find a solution myself but still to no avail.

I thank anyone in advance for you thoughts on trying to solve my dilemma.


Stephen

Idan K

unread,
Jul 31, 2010, 10:49:53 AM7/31/10
to Stephen Gariepy, msy...@googlegroups.com
Looking at the output you got, especially:


> bash: C:/Program: No such file or directory

Leads me to think that this has something to do with the space in 'Program Files', which isn't the first time I see programs misbehaving because of it in Windows.
I have no idea how to fix this in a more suitable manner, but try installing msysgit in a directory without spaces, maybe that'll help.

Pat Thoyts

unread,
Jul 31, 2010, 11:17:27 AM7/31/10
to Stephen Gariepy, msy...@googlegroups.com
On 31 July 2010 05:32, Stephen Gariepy <ste...@gariepy.com> wrote:
> I know this error pops up, and people seem to be able to fix it, but
> after trying the upteenth solution I'm starting to consider myself
> stuck, and I was hoping for a push in the right direction.
>
> I have installed msysgit on windows XP in c:/program files/git. I am
> trying to connect to my server at bluehost.com via ssh. I am trying to
> do the inital clone of that repository on the bluehost linux server.
>
> I'm currently typing in something like below and getting the error:
>> git clone ssh://us...@domain.com/~/git/domain.git/
>> Initialized empty Git repository in c:/xampp/htdocs/domain/.git
>> us...@domain.com's password:
>> bash: git-upload-pack: command not found
>> fatal: The remote end hung up unexpectedly

This is a problem with your server setup. When you use ssh to access
the repository on the server your ssh shell doesn't have a terminal
assigned and runs a slightly different initialization. It will not
read .profile but does read .bashrc. You can probably see the effect
if you try just 'ssh <you@server> type git' and it may just say git
not found. I suggest you extend your PATH in your ~/.bashrc to include
the directory containing the git executable.

>
> I don't really know where git-upload-pack is supposed to be running
> from, my computer or the server. I believe the server but at this
> point I'm lost.
>
> I've looked at the $PATH on the server and the git-core directory is
> in it. I've run the command "ssh us...@domain.com "which
> git-upload-pack" and got the answer "/bin:/usr/bin".

It shouldn't be. Only git should be on the path. That then deals with
finding the programs in git-core.

It will appear to be ok due to the difference in initialization
between a login/interactive shell and a non-interactive shell startup
(as described in the bash manual page).

Pat Thoyts

Stephen Gariepy

unread,
Aug 2, 2010, 6:17:17 PM8/2/10
to Pat Thoyts, msy...@googlegroups.com
Just to give an update on this, first thank you to Pat for making me
look at this from a different angle.

I found out that my web host provider (Bluehost) upgraded openssh, as
they state, (referenced in this forum post:
http://www.bluehostforum.com/showthread.php?20234-svn-ssh-problems&p=81494#post81494)

>A recent upgrade of openssh from 4 to 5 has changed the behavior of the way commands are called. This has affected anyone who has custom software installed into their own home directory, and call the commands via ssh directly, rather than entering a shell session first.

So I was able clone the repository by using the command

>git clone -u path/on/server/git-upload-pack <user>@<host>:~/git/gitrepository.git

I am going to try the commands from this forum post
(http://www.bluehostforum.com/showthread.php?20304-Bluehost-Solution-to-the-Git-PATH-issue-when-using-a-non-interactive-shell&p=81443#post81443)

>git config remote.origin.uploadpack 'libexec/git-core/git-upload-pack'
>git config remote.origin.receivepack 'libexec/git-core/git-receive-pack'

Hopefully this will be help me work as per normal

Stephen
_____________________________
Stephen Gariepy
  519.580.5281
  ste...@gariepy.com
  www.sgx.ca

Reply all
Reply to author
Forward
0 new messages