3

I'm using gitlab.com, and I'm not that used to with SSH Keys. BTW I've managed to create a SSH Key in my Windows 8 PC using cmd and Git bash. And I've managed to add that to my gitlab user account.

Now in my project "Deploy Keys" I'm seeing: Deploy Keys - gitlab.com

If I try to paste the same key here too, it's not adding because it's already taken.

The question can be answered by either of the following two:

  • How can I add the existing one then? or,
  • How can I make my SSH key active for my project, so that I can push into private repo of gitlab without username and password prompt?

1 Answer 1

5

You can't have one key both standard and "read-only". It does not make any sense.

If you want to "push into private repo of gitlab without username and password prompt". Just add the key as normal SSH-Key and you are good:

Profile Settings -> SSH keys

is the correct place where you should add your keys for read/write access.

Deploy keys are for read-only access!


Edit from comments: Also you need to change protocol, if you still use https. Change in .git/config in option url beginning from https://gitlab.com/ to [email protected]:

Sign up to request clarification or add additional context in comments.

4 Comments

I's pushing a repo previously, so I've a remote set already. I've added my SSH Keys to gitlab.com, but still it's prompting me for the username and password. (Screenshot)
If you want to use keys, you need to use ssh protocol and not https: Change the url in .git/config from https://gitlab.com... to [email protected]...
The replacement would be: from https://gitlab.com/ to [email protected]:. Thanks for the awesome to-the-point answer. Opened a new door to me. Thanks a lot.
thanks @Jakuje you saved my life with the comment about the URL :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.