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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:14:08  来源:igfitidea点击:

fatal: ssh variant 'simple' does not support setting port

gitsshtortoisegit

提问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 TortoiseGitPlinkis not detected any more as sshor plinkcompatible.

用于 SSH 工具检测的 Git (>=2.16.0) 的内部行为发生了变化,TortoiseGitPlink不再被检测为sshplink兼容。

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_VARIANTto sshor configure it in Git settings using git config --global ssh.variant ssh.

这仅影响 SSH URL 是否包含端口或您已将 Git 配置为使用协议版本 2。现在,您需要将环境变量设置GIT_SSH_VARIANTssh或在 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 TortoiseGitPLinkfrom 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 TortoiseGitPLinkfrom Git CLI also issue git config --global ssh.variant sshon CLI or set the environment variable GIT_SSH_VARIANTto ssh.
  • 将 TortoiseGit 更新到最新的稳定版本:https: //tortoisegit.org/download/
  • 如果您TortoiseGitPLink从 Git CLI使用,也会git config --global ssh.variant ssh在 CLI 上发出问题或将环境变量设置GIT_SSH_VARIANTssh.

回答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_VARIANTto ssh. This will solve the problem.

将环境变量设置GIT_SSH_VARIANTssh. 这将解决问题。

export GIT_SSH_VARIANT=ssh