尝试改为scp语法 http://www.hypexr.org/linux_scp_help.php,以确保您的~/.ssh/config
使用文件:
git remote set-url origin github:<username>/<repo>
然后尝试再次推动。
Git 本身使用 OpenSSH 版本(至少是带有适用于 Windows 的 Git https://github.com/git-for-windows/git/releases)
> ssh -V
OpenSSH_7.5p1, OpenSSL 1.0.2k 26 Jan 2017
正如“为什么 ssh 命令不遵循 URI 上的 RFC? https://unix.stackexchange.com/q/75668/7490”,两者之间有区别:
ssh://[user@]host.xz[:port]/path/to/repo.git
vs.
[email protected] /cdn-cgi/l/email-protection:/path/to/repo.git
仅后一种语法[email protected] /cdn-cgi/l/email-protection:
使用ssh 配置文件 https://www.ssh.com/ssh/config/.
最初开发 SSH 时,它是作为早期 RSH/rlogin 工具套件的更安全的直接替代品而开发的。
See "SSH 协议的历史 https://www.ssh.com/ssh/#sec-History-of-the-SSH-protocol".
OpenSSH https://en.wikipedia.org/wiki/OpenSSH(1999) 早于URI https://en.wikipedia.org/wiki/Uniform_Resource_Identifier(最终确定于RFC 3986 https://www.ietf.org/rfc/rfc3986.txt,发表于 2005 年 1 月)
如果允许主机部分出现在表单上host:port
,这会产生潜在的歧义:[email protected] /cdn-cgi/l/email-protection:2222
参考~jdoe/2222
on host.example.com
在标准端口上连接时,或者它根本没有引用任何文件(或更糟糕的是,~jdoe
) on host.example.com
通过端口 2222 连接时?