So if you need to explicitly set the upload-pack path on a git command using the msysgit shell, you’ll get a weird error. Apparently msys mucks up (in a lot of cases this is actually the desired behavior) paths. MSys alters the unix style path you entered to be windows style and prepends it with C:\PATHTOYOURGIT. This obviously confuses the server and causes a msysgit error on upload pack.
bash: C:/Git/PATHTOYOURUPLOADPACK/git-upload-pack: No such file or directory
fatal: The remote end hung up unexpectedly
So to fix this (which was a pain in the ass to find!) you simply begin path arguments with an extra slash.
git clone –upload-pack /home/myuser/bin/git-upload-pack myuser@mydomain.com:/home/myuser/gitprojects/agitproject.git
becomes
git clone –upload-pack //home/myuser/bin/git-upload-pack myuser@mydomain.com:/home/myuser/gitprojects/agitproject.git
http://osdir.com/ml/msysgit/2010-03/msg00139.html
- If you want to specify a different location for –upload-pack, you have
to start the absolute path with two slashes. Otherwise MSys will mangle
the path. git and bash have serious problems with non-ASCII file names
(Issue 80, 159).

Add A Comment