[...]
> Whenever i am executing this : git push origin master
>
> I am getting error as:
>
> sh: git-receive-pack: not found
> fatal: The remote end hung up unexpectedly
[...]
Most probably your Git binaries are not in the $PATH of the remote user.
See this [1] discussion for instance to get more insight on this.
1.
http://groups.google.com/group/git-users/browse_thread/thread/030fe5fc5bfa8185?hl=en#
On Tue, Mar 1, 2011 at 2:52 PM, Rishikesh Rajak <rishik...@gmail.com> wrote:
> Some more info:
>
> # ssh g...@xxx.com git upload-pack
> Password:
> sh: git: not found.
> #
>
> But this works:
>
> # ssh g...@xxx.com /usr/local/libexec/git-core/git upload-pack
> Password:
> usage: git upload-pack [--strict] [--timeout=<n>] <dir>
> #
>
> And another stuff if i do:
>
> # ssh g...@xxx.com
> Password:
> $ git upload-pack
> usage: git upload-pack [--strict] [--timeout=<n>] <dir>
> $ exit
> logout
> It works. So looks like somewhere i need to set global path at client side.
No, the problem is on the server-side. When you're logging in
interactively, a different shell-setup is performed than when a
non-interactive login happens. You'll have to make sure the
non-interactive login has git in it's path as well.
> Do you know where can i set this global path in msysGit source code ? Or
> somewhere in server side.
There is a "--upload-pack"-parameter to git-pull and git-fetch, but
unfortunately MSYS steps on it's toes by trying to translate the path.
It should work from CMD.EXE, though.
On Tue, Mar 1, 2011 at 3:55 PM, Rishikesh Rajak <rishik...@gmail.com> wrote:
>> > It works. So looks like somewhere i need to set global path at client
>> > side.
>>
>> No, the problem is on the server-side. When you're logging in
>> interactively, a different shell-setup is performed than when a
>> non-interactive login happens. You'll have to make sure the
>> non-interactive login has git in it's path as well.
>
>
> Can you please let me know the correct pointer, how to do it ?
This isn't my area of expertise, so no. It probably has something to
do with ~/.profile, ~/.bash_profile and/or ~/.bashrc, but I don't
really know the difference between them. I see that my ~/.bashrc on
one linux-box has this:
---8<---
# Check for an interactive session
[ -z "$PS1" ] && return
---8<---
So in this case, I would probably have to add git to the patch before
these two lines as non-interactive logins would terminate here. But as
I said, I'm not really the right person to give advice here.
[...]
> This isn't my area of expertise, so no. It probably has something to
> do with ~/.profile, ~/.bash_profile and/or ~/.bashrc, but I don't
> really know the difference between them. I see that my ~/.bashrc on
> one linux-box has this:
>
> ---8<---
> # Check for an interactive session
> [ -z "$PS1" ] && return
> ---8<---
>
> So in this case, I would probably have to add git to the patch before
> these two lines as non-interactive logins would terminate here. But as
> I said, I'm not really the right person to give advice here.
I concur.
~/.bashrc is read for interactive non-login runs where ~/.bash_profile
(or ~/.profile) -- for interactive login runs.
The original poster is advised to consult [1] as an example.
1. http://joemaller.com/908/how-to-install-git-on-a-shared-host/
See? This is precisely the reason why I stressed that point! :)
I've tried to figure out how this works before, but my conclusion was
that it seemed different distros had different ideas about the
difference.