git 致命:ssh 变体“简单”不支持设置端口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48417505/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
fatal: ssh variant 'simple' does not support setting port
提问by Nick Hsu
When I clone a remote GitLab project, I get the following error:
当我克隆远程 GitLab 项目时,出现以下错误:
error fatal: ssh variant 'simple' does not support setting port
I tried to re-install TortoiseGit, but this did not solve the issue.
我尝试重新安装 TortoiseGit,但这并没有解决问题。
回答by MrTux
The internal behavior of Git (>=2.16.0) for SSH tool detection changed and TortoiseGitPlink
is not detected any more as ssh
or plink
compatible.
用于 SSH 工具检测的 Git (>=2.16.0) 的内部行为发生了变化,TortoiseGitPlink
不再被检测为ssh
或plink
兼容。
This only affects if the SSH URL contains a port or you have configured Git to use the Protocol version 2. For now, you need to set the environment variable GIT_SSH_VARIANT
to ssh
or configure it in Git settings using git config --global ssh.variant ssh
.
这仅影响 SSH URL 是否包含端口或您已将 Git 配置为使用协议版本 2。现在,您需要将环境变量设置GIT_SSH_VARIANT
为ssh
或在 Git 设置中使用git config --global ssh.variant ssh
.
In the next version of TortoiseGit 2.5.7 this will be done automatically when TortoiseGitPLink is invoked by TortoiseGit (cf. https://tortoisegit.org/issue/3139). If you use TortoiseGitPLink
from CLI the setting is still needed).
在 TortoiseGit 2.5.7 的下一版本中,这将在 TortoiseGit 调用 TortoiseGitPLink 时自动完成(参见https://tortoisegit.org/issue/3139)。如果您TortoiseGitPLink
从 CLI使用,则仍然需要设置)。
Update (TLDR):
更新(TLDR):
- Update TortoiseGit to the latest stable version: https://tortoisegit.org/download/
- I f you use
TortoiseGitPLink
from Git CLI also issuegit config --global ssh.variant ssh
on CLI or set the environment variableGIT_SSH_VARIANT
tossh
.
- 将 TortoiseGit 更新到最新的稳定版本:https: //tortoisegit.org/download/
- 如果您
TortoiseGitPLink
从 Git CLI使用,也会git config --global ssh.variant ssh
在 CLI 上发出问题或将环境变量设置GIT_SSH_VARIANT
为ssh
.
回答by MozenRath
if you are using Windows version of git, try this:
如果您使用的是 Windows 版本的 git,请尝试以下操作:
git config --global ssh.variant ssh
git config --global ssh.variant ssh
This is a better option for those who don't want to clutter the environment variables a lot.
对于那些不想把环境变量弄得乱七八糟的人来说,这是一个更好的选择。
回答by Ashish
Set environment variable GIT_SSH_VARIANT
to ssh
. This will solve the problem.
将环境变量设置GIT_SSH_VARIANT
为ssh
. 这将解决问题。
export GIT_SSH_VARIANT=ssh