Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'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?

like image 323
Jake Stevenson Avatar asked Apr 20 '11 14:04

Jake Stevenson


1 Answers

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

or

git bundle create repo.bundle --all

# receive it on the remote
scp TheDesktop:repo.bundle
git clone repo.bundle TheProject
like image 120
sehe Avatar answered Sep 21 '22 00:09

sehe