'X' does not appear to be a git repository (I'm sure the path is correct)
I want to be able to work from home by cloning of the git repository that exists on my work desktop to my laptop. Both systems are running msysgit within a cygwin shell. Both systems are using cygwin’s ssh.
If I ssh to that server, I can see the repository at the path /cygdrive/d/Projects/TheProject
$ ssh TheDesktop MyUser@TheDesktop's password: ...I enter the password, see the MOTD, and I'm in... $ cd /cygdrive/d/Projects/TheProject ...See the git repository here. Even see the current branch in the prompt...
But I try to clone and it fails:
$ git clone ssh://TheDesktop/cygdrive/d/Projects/TheProject Cloning into TheProject MyUser@TheDesktop's password: ...I enter the password... fatal: '/cygdrive/d/Projects/TheProject' does not appear to be a git repository fatal: The remote end hung up unexpectedly
I’ve also tried symlinking the repository to my home folder:
$ ssh TheDesktop MyUser@TheDesktop's password: ...I enter the password... $ ln -s /cygdrive/d/Projects/TheProject . $ exit $ git clone ssh://TheDesktop/~/TheProject Cloning into TheProject MyUser@TheDesktop's password: ...I enter the password... fatal: '/cygdrive/d/Projects/TheProject' does not appear to be a git repository fatal: The remote end hung up unexpectedly
I certainly see this error in a lot of questions here, and they almost always relate to a bad path. But I’m really certain my path is correct. I get the feeling it has something to do with the environment being ssh’d into on the desktop, but I really can’t figure out what. What other things could cause this error?
3 Solutions collect form web for “'X' does not appear to be a git repository (I'm sure the path is correct)”
git clone TheDesktop:cygdrive/d/Projects/TheProject TheProject
should fix it
If the ssh server is not under cygwin, substitute the windows path:
cygpath --mixed /cygdrive/d/Projects/TheProject
It is my experience that cygwin passes the wrong path style to msysgit. Msysgit doesn’t understand /cygdrive and therefore messes it up, except with a single argument on the commandline, in which case cygwin bash appears to do the conversion magically.
However, no such thing will be true for gitshell over cygwin sshd. I’m assuming you tried something close to
git clone TheDesktop:D:/Projects/TheProject TheProject
If that didn’t work, I’d look at
git daemon # wasn't supported on Windows last time I checked
git bundle create repo.bundle --all # receive it on the remote scp TheDesktop:repo.bundle git clone repo.bundle TheProject
you need to clone the repository itself, not the associated working tree:
$ git clone ssh://TheDesktop/cygdrive/d/Projects/TheProject/.git TheProject
It might have to do with that git wants to find “cygdrive/d/Projects/TheProject” relative to your login folder.
In your first example you login via ssh and then do “cd /cygdrive/…”, which is an absolute path, not relative.
Changing your ssh login folder to point to e.g. the Projects-folder might help you out. And also shorten your ssh path 🙂