git 无法使用 SSH 将 IntelliJ-IDEA 连接到 GitLab

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31975143/
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 03:28:19  来源:igfitidea点击:

Can't connect IntelliJ-IDEA to GitLab with SSH

gitintellij-ideasshgitlab

提问by Sebastian Garces

I am trying to connect my GitLab repository with IntelliJ-IDEA, and it still cant connect to the repo. I have tried the next things:

我正在尝试将我的 GitLab 存储库与 IntelliJ-IDEA 连接起来,但它仍然无法连接到存储库。我已经尝试了接下来的事情:

  • I have msysgit installed correctly
  • Generated the SSH keys (https://help.github.com/articles/generating-ssh-keys/)
  • Added the key on GitLab keys
  • Define the enviroment variables HOME USERPROFILE point to C:\Users\sebastian.garces.ssh. %USERPROFILE$/.ssh %HOME$/.ssh
  • In IntelliJ changed SSH executable to Native
  • 我已经正确安装了 msysgit
  • 生成 SSH 密钥 ( https://help.github.com/articles/generating-ssh-keys/)
  • 在 GitLab 密钥上添加了密钥
  • 定义环境变量 HOME USERPROFILE 指向 C:\Users\sebastian.garces.ssh。%USERPROFILE$/.ssh %HOME$/.ssh
  • 在 IntelliJ 中将 SSH 可执行文件更改为 Native

I did a lot of things from this links:

我从这个链接做了很多事情:

And many other google searchs

以及许多其他谷歌搜索

I dont know what else to do nothing is working.

我不知道还能做什么,什么都不做。

UPDATE:When i try to Clone the repository and press the TestButton it loads and loads and nothing happen after a while it give me this error: repository test has failed

更新:当我尝试克隆存储库并按下“测试”按钮时,它加载并加载,一段时间后没有任何反应,它给我这个错误:存储库测试失败

回答by fpopic

Try to install plugin: Settings-> Plugins-> Browse repositories-> type GitLab Projects Pluginminimum version 1.3.0

尝试安装插件: Settings-> Plugins-> Browse repositories-> 输入GitLab Projects Plugin最低版本 1.3.0

and go to Settings-> Other Settings-> GitLab Settings

然后去Settings-> Other Settings->GitLab Settings

Fill GitLab Server Urlwith https://gitlab.com/(ensure slash at the end) and

填充GitLab Server Urlhttps://gitlab.com/(确保在最后的斜线)和

GitLab API Keywith string (private token which is shown as the first thing on: https://gitlab.com/profile/account)

GitLab API Key带字符串(显示为第一件事的私有令牌:https: //gitlab.com/profile/account

enter image description here

在此处输入图片说明

And then the test in IntelliJ IDEA will pass and you will be able to use ssh or https for each repository...

然后 IntelliJ IDEA 中的测试将通过,您将能够对每个存储库使用 ssh 或 https...

UPDATE: GitLab UI changed, so private tokens are created at https://gitlab.com/profile/personal_access_tokens

更新:GitLab UI 已更改,因此在https://gitlab.com/profile/personal_access_tokens上创建了私有令牌

回答by user7453089

The plugin worked for me after I found that a forward slash was missing after the .com in - GitLab Server Url with https://gitlab.com/OS - Mac IDE - IntelliJ Plugin - GitLab Projects Plugin HTH SK

在我发现 .com 之后缺少正斜杠后,该插件对我有用 - GitLab Server Url with https://gitlab.com /OS - Mac IDE - IntelliJ Plugin - GitLab Projects Plugin HTH SK

回答by Valérie Lemieux

If you are you Windows and tried to clone a gitlab project and it failed, make sure to :

如果您是 Windows 并尝试克隆 gitlab 项目但失败了,请确保:

  1. Have setup a password in Gitlab (after registration, you'll need to create a password in your Account Setting)

  2. In Windows, access the Credential Manager

  3. Find Suppress gitlab accesses

  4. Retry cloning the project

  1. 在 Gitlab 中设置了密码(注册后,您需要在帐户设置中创建密码)

  2. 在 Windows 中,访问凭据管理器

  3. 查找抑制 gitlab 访问

  4. 重试克隆项目

For me, it worked!

对我来说,它奏效了!