我正在尝试在我们的Windows服务器上建立一个git存储库。我安装了Windows的OpenSSH和Windows的Git。OpenSSH服务器在端口2345上运行,以过滤掉通用漫游器。
我在C:\ git \ protocolrepo.git上创建了一个裸露的共享存储库我无法通过以下网址到达它:
ssh://User@[email protected]:2345:C:/git/protocol.git
在我看来,这是一个格式错误的URL,但是当我在网上看到的任何地方,我都能得到这个,但它根本无法正常工作。
正如我在此线程中发现的:https://github.com/PowerShell/Win32-OpenSSH/issues/895,可能是shell引起的,所以我将powershell设置为OpenSSH的默认shell。这也不起作用,我仍然需要使用这个格式奇怪的URL。因此,我安装了Cygwin并将Cygwin bash设置为默认外壳,并使用了更合适的网址:
ssh://User@[email protected]:2345/cygdrive/c/git/protocol.git
我在此方面取得了一些成功,但现在它显示以下错误消息:
fatal: '/cygdrive/c/git/protocol.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
当我一起使用同一用户时,访问权限应该很好,但是我不确定100%在Windows上如何工作。我不确定Git / ssh如何在Windows上处理此路径。
在基于Linux的服务器上,此路径在/git/protocol.git
路径下工作正常。
将新分支推送到裸仓库是我很久没有做过的事情,因此在这里也可能做错了,但我不记得这是一个问题。
您建议如何调试此问题?
在考虑使用Git存储库SSH URL之前,我将首先检查交互式SSH会话是否有效。
ssh -p 2345 User@[email protected]
如果是,请尝试在该交互式外壳程序中访问/C/git/protocol.git
。
如果可行,请尝试使用git命令的URL
ssh://User@[email protected]:2345/C/git/protocol.git
# or
ssh://User@[email protected]:2345/c/git/protocol.git