31

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:

  • 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

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 Test Button it loads and loads and nothing happen after a while it give me this error: repository test has failed

Community
  • 1
  • 1
Sebastian Garces
  • 346
  • 1
  • 3
  • 11

4 Answers4

48

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

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

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

GitLab API Key with string (private token which is shown as the first thing on: 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...

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

fpopic
  • 1,756
  • 3
  • 28
  • 40
  • sure, but I tried without the "http://" and it didn't work, as I assumed it adds it iself, but no. – Jon Jun 10 '16 at 07:53
  • 1
    Funny this works in intellij, but not in webstorm. Thanks for the concise guide – smac89 Aug 05 '16 at 19:20
  • 2
    All of the above was still not enough for me. 'unable to access', 'ssl certificate problem' unable to get loca issuer certificate – B Furtado Oct 08 '16 at 13:48
  • check this https://docs.gitlab.com/ce/ssh/README.html Something must be missing in your C:\Users\User\.ssh folder (my looks like this http://www.deviantpics.com/images/2016/10/08/ssh.png) – fpopic Oct 08 '16 at 20:41
  • What's the difference between the first (`git@gitlab.com...`) and the second (`https://gitlab.com...`) entry? From which one should I checkout? – Robb1 May 25 '17 at 14:27
  • first is ssh connection and the second is https connection, you can use any of them if your git host supports it, for GitHub chek this out: https://stackoverflow.com/questions/11041729/why-does-github-recommend-https-over-ssh – fpopic May 25 '17 at 14:40
4

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

2

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

  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

For me, it worked!

fphilipe
  • 9,739
  • 1
  • 40
  • 52
  • Great advise, it helps! What I also did: put your Personal Access Token into password field. At https://gitlab.com/-/profile/personal_access_tokens it clearly (but not visible enough) says: "You can also use personal access tokens to authenticate against Git over HTTP. They are the only accepted password when you have Two-Factor Authentication (2FA) enabled." – Artsiom Chapialiou Sep 29 '21 at 21:43
0

For those struggling to get past the authentication issues when pulling from Gitlab. Of course, you can get it to work via the command line by adding the key to an ssh-agent. But IntelliJ didn't seem to hook on to that.

I got Git to work on IntelliJ by using the credential helper which will ask you and cache the credentials. Here is the config in question: enter image description here

UltimaWeapon
  • 690
  • 9
  • 8