sh: git-receive-pack: command not found

178 views
Skip to first unread message

mac

unread,
Apr 19, 2009, 5:56:42 PM4/19/09
to msysGit
I've downloaded the portable version (git version 1.6.2.2.1669.g7eaf8)
on windows XP and played around a bit.

Now I just tried to do a "git push origin master" but got
sh: git-receive-pack: command not found
fatal: The remote end hung up unexpectedly

I also tried to do it from gitk with Remote->Add with Name: "origin"
and Location: "c:/temp" and set "Initialize Remote Repository and
Push". I can see that the repository got initialized fine, but I got
the same "sh: git-receive-pack: command not found" error.

Perhaps I'm doing something completely wrong when installing?
I just installed the portable version to a directory of my choice (c:
\git) and added c:\git\bin) to my PATH.

Please enlighten me.

Clifford Caoile

unread,
Apr 20, 2009, 9:26:20 AM4/20/09
to magnusl...@gmail.com, msysGit
Hi

On Mon, Apr 20, 2009 at 06:56, mac <magnusl...@gmail.com> wrote:
>
> I've downloaded the portable version (git version 1.6.2.2.1669.g7eaf8)
> on windows XP and played around a bit.
>
> Now I just tried to do a "git push origin master" but got
>  sh: git-receive-pack: command not found
>  fatal: The remote end hung up unexpectedly
>

> Perhaps I'm doing something completely wrong when installing?

No, actually this looks like a bug? I confirmed it fails with
PortableGit-1.6.2.2-preview20090408.exe.

I was going to suggest "If you are using the Windows Command Prompt
(cmd.exe) as your shell, please put c:\git\cmd in your path instead of
c:\git\bin.", but I confirm that that fails as well. (>_<;) BTW, the
preceding instruction is still recommended because that's how the
regular git on msys installer version works.

It seems somewhere in the %PORTABLEGIT%\bin\git.exe there is a string
"git-receive-pack". I suspect that this string is used to call out to
the receive-pack functionality via "git-receive-pack". BTW, one of the
big interface changes from 1.5.x to 1.6.x was to deprecate "git-*"
(hyphen) in favor of "git *" (no hyphen) for the sub commands, so this
could be one of those missed things.

For a really quick workaround, copy git.exe to "git-receive-pack.exe"
and re-run your command. Works On My Machine (TM), so YMMV. This is
NOT a permanent solution.

I'm going to try to track down this one, however I have not been
tracking the latest msysgit stuff since July of last year. Heh. (^_^);

Best regards,
Clifford Caoile

Clifford Caoile

unread,
Apr 20, 2009, 9:35:20 AM4/20/09
to magnusl...@gmail.com, msysGit
On Mon, Apr 20, 2009 at 06:56, mac <magnusl...@gmail.com> wrote:
>
> I've downloaded the portable version (git version 1.6.2.2.1669.g7eaf8)
> on windows XP and played around a bit.

BTW, this is not related to your problem, but as you are a user of the
PortableGit, can you please take a look at this README.portable draft
written by kurt.pfeifle and add your comments?

http://groups.google.com/group/msysgit/browse_thread/thread/3db7868fc995a80f/c8b09fbd7b560e5d

Best regards,
Clifford Caoile

mac

unread,
Apr 20, 2009, 11:25:53 AM4/20/09
to msysGit


On Apr 20, 3:26 pm, Clifford Caoile <p...@users.sourceforge.net>
wrote:
> It seems somewhere in the %PORTABLEGIT%\bin\git.exe there is a string
> "git-receive-pack". I suspect that this string is used to call out to
> the receive-pack functionality via "git-receive-pack". BTW, one of the
> big interface changes from 1.5.x to 1.6.x was to deprecate "git-*"
> (hyphen) in favor of "git *" (no hyphen) for the sub commands, so this
> could be one of those missed things.

Ok, thanks for the quick reply.

Then I can now reveal that I removed the hyphen in the following two
files as well ;-)

git/libexec/git-submodule L109 " git clone -n ..."
git/libexec/git-pull L193 "exec git-merge $exec git-merge ..."

> For a really quick workaround, copy git.exe to "git-receive-pack.exe"
> and re-run your command. Works On My Machine (TM), so YMMV. This is
> NOT a permanent solution.

A quick test in gitk.exe suggests that it works for me as well :-)

I'll also take a look at the README.portable draft as you suggested.

Clifford Caoile

unread,
Apr 20, 2009, 11:06:17 AM4/20/09
to magnusl...@gmail.com, msysGit
On Mon, Apr 20, 2009 at 22:26, Clifford Caoile
<pi...@users.sourceforge.net> wrote:
> On Mon, Apr 20, 2009 at 06:56, mac <magnusl...@gmail.com> wrote:
>> I've downloaded the portable version (git version 1.6.2.2.1669.g7eaf8)
>> on windows XP and played around a bit.
>>
>> Now I just tried to do a "git push origin master" but got
>>  sh: git-receive-pack: command not found
>>  fatal: The remote end hung up unexpectedly
>>
>> Perhaps I'm doing something completely wrong when installing?
>
> No, actually this looks like a bug? I confirmed it fails with
> PortableGit-1.6.2.2-preview20090408.exe.
>
> I'm going to try to track down this one, however I have not been
> tracking the latest msysgit stuff since July of last year. Heh. (^_^);

Instead of diving directly into the source, I tried out the latest git
on msys installer to test its behavior. It looks like it works
correctly.
http://msysgit.googlecode.com/files/Git-1.6.2.2-preview20090408.exe

So there is a possibility that the packaging makes the difference. I
naively thought that they both should install the same binaries as the
PortableGit.
http://msysgit.googlecode.com/files/PortableGit-1.6.2.2-preview20090408.exe

BTW, the failure I confirmed is when I ran the PortableGit.*.exe by
itself, not extracting via some other process like 7-zip.

One big difference I see is that in the %PORTABLEGIT%\libexec\git-core
directory, there are no files that have the same size (possible
hardlink?) as the bin\git.exe, which includes git-receive-pack.exe. I
don't have a clue as to why the PortableGit version has a different
libexec\git-core. Perhaps this is a usage restriction of the Installer
used for PortableGit, which is called 7zSD.sfx?

I see that in the ${MSYSGIT}/share/WinGit/portable-release.sh that
some 7zSD.sfx options are used.
http://sevenzip.sourceforge.jp/chm/cmdline/switches/sfx.htm
First off, I don't see how the PortableGit installer reconstitutes the
hardlinks in the same way as the regular Git installer. Perhaps it
does not because 7zSD.sfx does not have this capability?

I notice there is a "RunProgram" and "ExecuteFile" command that allows
to run an arbitrary command. Is it possible to run a program during
the installation to recreate the hardlinks? I assume that the regular
Git installer does that. Whoops, it looks like it's done inside of the
(InstallShield?) install.iss script, so it's not a free standing
binary. Um.

As I see it, the problem can be solved in the following ways:
1. Add a program to fix up the %PORTABLEGIT%\libexec\git-core
directory with either hardlinks or copies of git.exe depending on the
FS (OMG it could be VFAT), and run it silently after Extraction.
2. ??? (gee it sounded better when plural)

BTW, why has PortableGit worked so well without user complaints up
until now? (>_<)/

Best regards,
Clifford Caoile

Johannes Schindelin

unread,
Apr 20, 2009, 11:50:34 AM4/20/09
to Clifford Caoile, magnusl...@gmail.com, msysGit
Hi,

On Tue, 21 Apr 2009, Clifford Caoile wrote:

> BTW, why has PortableGit worked so well without user complaints up until
> now? (>_<)/

PortableGit is a fresh addition, and as you pointed out, it misses the
builtins.

Ciao,
Dscho

Johannes Schindelin

unread,
Apr 20, 2009, 11:59:15 AM4/20/09
to Clifford Caoile, magnusl...@gmail.com, msysGit
Hi,

I just fixed and pushed a fix.

Thanks for the report and the analysis!

Ciao,
Dscho

Reply all
Reply to author
Forward
0 new messages