我希望能够通过将我的工作桌面上存在的 git 存储库克隆到我的笔记本电脑来在家工作。两个系统都在 cygwin shell 中运行 msysgit。两个系统都使用 cygwin 的 ssh。
如果我 ssh 到该服务器,我可以在路径 /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...
但我尝试克隆,但失败了:
$ 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
我还尝试将存储库符号链接到我的主文件夹:
$ 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
我当然在这里的很多问题中都看到了这个错误,它们几乎总是与错误的路径有关。但我真的很确定我的道路是正确的。我觉得它与桌面上 ssh 进入的环境有关,但我真的不知道是什么。还有哪些其他因素可能导致此错误?