git-receive-pack not found

1,413 views
Skip to first unread message

rishi

unread,
Mar 1, 2011, 5:11:00 AM3/1/11
to msysGit
I am planning to setup git server using msysGit.

I followed this steps: http://tumblr.intranation.com/post/766290565/how-set-up-your-own-private-git-server-linux

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

Please help me to solve this issue.

From here i downloaded the packages:

http://code.google.com/p/msysgit/downloads/detail?name=msysGit-fullinstall-1.7.4-preview20110204.exe&can=2&q=

Infact i reffered this mail also but it did not help:
http://groups.google.com/group/msysgit/browse_thread/thread/c7ef015bcb57d7a4

Thanks for helping me.

Regards
Rishi

Konstantin Khomoutov

unread,
Mar 1, 2011, 6:28:17 AM3/1/11
to rishi, msysGit
On Tue, 1 Mar 2011 02:11:00 -0800 (PST)
rishi <rishik...@gmail.com> wrote:

[...]


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

Rishikesh Rajak

unread,
Mar 1, 2011, 8:52:19 AM3/1/11
to Konstantin Khomoutov, msysGit
Thanks for reply.
 
I had set this variable on remote user.
$ git --exec-path
/usr/local/libexec/git-core
$ ls -l /usr/local/libexec/git-core/git-receive*
-rwxr-xr-x  105 root       sys        4399568 Jan 21 08:37 /usr/local/libexec/git-core/git-receive-pack
$
So it does not like a path problem. From window machine i am trying to do "git push origin master".
 
Few other thing is that, when i execute some command with normal ssh , it works. e.g:
 
From client machine if execute this command:
 
# git clone ssh://g...@xxx.com/~/myrepo.git
Cloning into hart...
warning: templates not found /usr/local/share/git-core/templates
The authenticity of host 'xxx.com (15.154.119.22)' can't be established.
RSA key fingerprint is e5:c9:c5:38:bd:62:93:af:78:19:db:e9:9a:1b:11:0f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'xxx.com,xx.xxx.xxx.xx' (RSA) to the list of known hosts.
Password:
sh: git-upload-pack:  not found.

fatal: The remote end hung up unexpectedly
#
 
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. Do you know where can i set this global path in msysGit source code ? Or somewhere in server side.
 
Regards
Rishi

Erik Faye-Lund

unread,
Mar 1, 2011, 9:14:24 AM3/1/11
to Rishikesh Rajak, Konstantin Khomoutov, msysGit
Please don't top-post on this mailing list. I've replied inline, as
you should in the future.

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.

Erik Faye-Lund

unread,
Mar 1, 2011, 10:22:16 AM3/1/11
to Rishikesh Rajak, msysGit
Please, don't cull the CC-list. I've fixed it for you this time.

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.

Konstantin Khomoutov

unread,
Mar 1, 2011, 11:02:56 AM3/1/11
to kusm...@gmail.com, Rishikesh Rajak, msysGit
On Tue, 1 Mar 2011 16:22:16 +0100
Erik Faye-Lund <kusm...@gmail.com> wrote:

[...]


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

Erik Faye-Lund

unread,
Mar 2, 2011, 4:54:54 AM3/2/11
to Konstantin Khomoutov, Rishikesh Rajak, msysGit
On Tue, Mar 1, 2011 at 5:02 PM, Konstantin Khomoutov
<flat...@users.sourceforge.net> wrote:
> On Tue, 1 Mar 2011 16:22:16 +0100
> Erik Faye-Lund <kusm...@gmail.com> wrote:
>
> [...]
>> 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.

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.

Reply all
Reply to author
Forward
0 new messages