【发布时间】:2020-08-04 07:16:12
【问题描述】:
我正在尝试在我们的 Windows 服务器上设置一个 git 存储库。
我安装了适用于 Windows 的 OpenSSH 和适用于 Windows 的 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,shell 可能是原因,所以我将 powershell 设置为 OpenSSH 的默认 shell。
这也不起作用,我仍然需要使用这个奇怪的 URL。
所以我安装了 Cygwin 并将 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.
访问权限应该没问题,因为我使用的是同一个用户,但我不能 100% 确定这在 Windows 上是如何工作的。
我不确定 Git/ssh 如何在 Windows 上处理此路径。
在基于 Linux 的服务器上,这与 /git/protocol.git 路径配合得很好。
将新分支推送到裸存储库是我有一段时间没有做过的事情,所以这里也可能做错了,但我不记得这是个问题。
你会推荐什么来调试这个问题?
【问题讨论】:
标签: windows git ssh cygwin openssh