Search code examples
gitredhatmsysgit

git clone from linux to a windows with git-upload-pack not found. Msysgit prepend "windows path" to git-upload-pack


Everything is in the title.

I'm pushing from a Windows XP with MSysGit installed. I'm pushing on a Linux (RHEL 5) which doesn't have git installed in /usr or in /usr/local (no admin right on the box)

When I'm doing a :

git clone user@redhatbox:~/repo/myrepo.git

It failed because of git-upload-pack not found. So I use my super skills to read the manpage and add

git clone -u "/path/on/the/redhat/to/git-upload-pack" user@redhatbox:~/repo/myrepo.git

And what I get is :

ksh: line 1: D:/users/myuser/softs/Git/path/on/the/redhat/to/git-upload-pack: not found
fatal: The remote end hung up unexpectedly

This %*$$~@ prepend a windows path to my path that should be the one on the redhat.

Oh yeah, we use ksh :(


Solution

  • It appears that MSysGit recognized a "unix path" in my command and prepend windows path in it, even if it has nothing to do with it. The way to avoid that behaviour :

    git clone -u "\/path/on/the/redhat/to/git-upload-pack" user@redhatbox:~/repo/myrepo.git
    

    Yes, put a \ before the first / in the path. MSysGit won't interpret it and won't prepend some windows path before. You need to put the path in " too.