'X'似乎不是一个git存储库(我确定路径是正确的) [英] 'X' does not appear to be a git repository (I'm sure the path is correct)
问题描述
我想通过将工作桌面上存在的git存储库克隆到我的笔记本电脑,从家里工作。这两个系统都在cygwin shell中运行msysgit。两个系统都使用cygwin的ssh。
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.
如果我ssh到那个服务器,我可以在路径/ cygdrive / d / Projects / TheProject
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...
但我尝试克隆, / p>
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
我肯定在这里看到很多问题的错误,他们几乎总是涉及一个坏的路径。但我真的确定我的道路是正确的。我得到的感觉,它与环境是ssh'd到桌面上,但我真的不能弄清楚什么。什么其他事情可能导致此错误?
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?
推荐答案
git clone TheDesktop:cygdrive/d/Projects/TheProject TheProject
应修复它
如果ssh服务器不在cygwin,替换windows路径:
If the ssh server is not under cygwin, substitute the windows path:
cygpath --mixed /cygdrive/d/Projects/TheProject
这是我的经验cygwin传递错误的路径样式到msysgit。 Msysgit不理解/ cygdrive,因此混淆,除了在命令行上的一个参数,在这种情况下cygwin bash似乎做神奇的转换。
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.
然而,没有这样的事情会对cygwin sshd gitshell是真的。我假设你尝试了接近
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
这篇关于'X'似乎不是一个git存储库(我确定路径是正确的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!