繁体   English   中英

Windows、Git 和 SSH 裸存储库的 URL/路径

[英]Windows, Git and the SSH url/path of a bare repository

我正在尝试在我们的 Windows 服务器上设置 git 存储库。
我为 Windows 和 Git 为 Windows 安装了 OpenSSH。
OpenSSH 服务器在端口 2345 上运行以过滤掉通用机器人。

我在 C:\git\protocolrepo.git 上创建了一个裸共享存储库
我无法使用 URL 到达它:

ssh://User@domain@server.com:2345:C:/git/protocol.git

在我看来,它似乎是一个畸形的 URL 但是我在 web 上看到的所有地方我都明白了,但它只是不起作用。

As I found out in this thread: https://github.com/PowerShell/Win32-OpenSSH/issues/895 , the shell might be the cause, so I set the powershell as the default shell of OpenSSH.
这也不起作用,我仍然需要使用这个奇怪的 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路径配合得很好。

将新分支推送到裸存储库是我有一段时间没有做过的事情,所以这里也可能做错了,但我不记得这是个问题。

你会推荐什么来调试这个问题?

I would start by checking if an interactive SSH session works, before considering using a Git repo SSH URL.

ssh -p 2345 User@domain@server.com

如果是这样,请尝试在该交互式 shell 中访问/C/git/protocol.git

如果可行,请尝试使用 git 命令 URL

ssh://User@domain@server.com:2345/C/git/protocol.git
# or
ssh://User@domain@server.com:2345/c/git/protocol.git

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM