Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

git-upload-pack errors occur when sshing into cygwin. sshd in cygwin does not take paths from .bash_profile as expected in a *nix environment.

What is the way to remedy this and make msysgit work properly with cygwin bash and cygwin ssh?

share|improve this question
Please frame this as a question and post your answer in the below section meant for answers. Thanks. – Sathya Aug 20 '11 at 15:51
Done it's now a wiki. – sabgenton Aug 21 '11 at 5:57

I looked every where with people getting git-upload-pack missing errors like myself and came up with this.

Basicly this just sets Cygwins ssh path to have msysgit in it

  • Install msysgit (use git bash only should be enough we don't need the git.cmd thing for cygwin)

  • Install cygwin search for ssh and tick/check it.

    ssh-host-config -y 

    I didn't bother setting the CYGWIN var to anything the defaults seemed correct.

    cygrunsrv.exe -R sshd 

remove the service that was created in the process


    mSysgit="/usr/local/bin:/c/WINDOWS/system32:/c/WINDOWS:/cygdrive/c/Program Files/Git/bin:/cygdrive/c/Program Files/Git/libexec/git-core"

now add these two strings to the path below:

    cygrunsrv -I sshd -d "CYGWIN sshd" -p /usr/sbin/sshd -a -D -e "PATH=$ssheNv:$mSysgit"

    cygrunsrv.exe -S 

start the service (use -E to stop again if you want)

from another PC with msysgit

git clone  ssh://dude@hostIPetc'/Documents and Settings/blabla/myrepo.git'

For this people that didn't have git-upload-pack in their path well this fixes it. I don't have to install cygwin git just to satisfy paths!

Question though can any one figure out how to point to cygwin paths "/cygdrive/d/" etc? right now only / works and that means C:\

If anyone thinks this is all to sloppy and one should just use cygwin git please say so.

hmm MSysGit “fakes” filemodes is that a reason to switch to cygwin or is it helpfull on windows...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.