我正在尝试在我们的Windows服务器上设置git仓库。
我安装了Windows的OpenSSH和Git。
OpenSSH服务器运行在端口2345上,以过滤掉通用机器人。
我在C:\git\protocolrepo.git创建了一个裸仓库,并共享它。
我无法通过URL访问它:
ssh://User@domain@server.com:2345:C:/git/protocol.git
在网络上搜索后,我发现这个URL似乎格式有误,但无论我在哪里查找都是这样,但实际上它并不能工作。根据此帖子:https://github.com/PowerShell/Win32-OpenSSH/issues/895,可能是命令行引起的问题,所以我将powershell设置为OpenSSH的默认shell。
但这也没有起作用,我仍然需要使用这个奇怪格式的URL。因此,我安装了Cygwin并将其bash设为默认shell,并使用了一个更合适格式的URL。
ssh://User@domain@server.com: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.
访问权限应该没问题,因为我总是使用同一个用户,但我不确定在Windows上如何运行。
我也不确定Git/ssh在Windows上如何处理这个路径。
在基于Linux的服务器上,
/git/protocol.git
路径可以正常工作。很久以前我没有给裸仓库推送新分支了,所以这里可能做错了,但我不记得有过问题。
你会建议采取什么方法来调试此问题?
ls /c/git/protocol.git
吗?或者只能通过/cygdrive/c/git/protocol.git
执行吗? - VonC