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