Gitkraken with SSH to Gitlab

12,101

If the repo was cloned with HTTPS then no changes to SSH settings will work. You will first have to change the URL for your remote. Luckily you can do this inside GitKraken.

First you should navigate to your repo in GitKraken.

  1. In the left panel expand the remote group (represented by a cloud). This panel may be hidden, if so you'll need to click the right facing arrow symbol that should appear under the folder icon in the top left.

Image of panel reveal button1

  1. With the remote group expanded you should see a source called Origin. Hovering over this item reveals a vertical "...", that is the options button.

Image of "..."[2

  1. Click options and select "Edit Origin". This will open a sub-window that that will have two text boxes you can edit. The push and pull urls. switch these from https://gitlab.com/user/repo.git to [email protected]:user/repo.git

Once these steps are done then you can start changing GitKraken's ssh settings. In Windows if you aren't using Pagent (from PuTTY) then you shouldn't select "use local agent" in GitKraken. Without Pagent you can only use one key at a time and change the settings when you need to change keys.

If you wanted to use the command line to change the URL you can run the git-bash equivalent to git remote set-url [email protected]:user/repo.git from within the repo's root directory.

PS: Sorry that I can't embed images directly into my answer, not enough karma for that yet. Same for extra links.

Share:
12,101
Diogo Mendonça
Author by

Diogo Mendonça

Updated on June 27, 2022

Comments

  • Diogo Mendonça
    Diogo Mendonça almost 2 years

    I've been having a hard time getting the auth to work with ssh keys (don't want to be prompted for user and pass every time). Configuration options / tutorials for this issue are scarce/nonexistant.

    Here is the setup:

    • I believe the repo from Gitlab was added with https, can't find a way to change this, don't know if it's important.

    • I'm running Windows 10 with git-bash and have followed the tutorial on Github to generate the keys and add them to the ssh-agent. Added the public one to my gitlab profile and can "ssh -T [email protected]" successfully.

    • Have messed around with the profile inside .gitkraken and changed the paths for the ssh keys to: "useLocalAgent": true, "privateKey": "C:\Users\mendo\.ssh\id_rsa", "publicKey": "C:\Users\mendo\.ssh\id_rsa.pub".
    • When I do a pull I'm always prompted to insert the username and pass (even though I started the ssh-agent process from the git-bash).

    Don't know how I can solve this so any help you guys can provide will be much appreciated. Also, can't find a single way in app or online to remove/delete a repository from the app (I hope it's not obvious and I'm making a fool of myself).

    Thanks in advance for your help!

    Best, Diogo

  • Diogo Mendonça
    Diogo Mendonça over 7 years
    Thanks for your help but it wasn't successful. Restarted ssh-agent and gitkraken but it still didn't work. I believe I read somewhere that Gitkraken sets those properties according to the profile I'm using in the program.
  • Ajay P. Prajapati
    Ajay P. Prajapati over 7 years
    ohh alright, but may i know why you using gitkraken ? any reason?
  • Diogo Mendonça
    Diogo Mendonça over 7 years
    Wanted a change from SourceTree and the UI and ease of use are very cool.
  • Marcello Nicoletti
    Marcello Nicoletti over 7 years
    The Local Agent section here has some more information about the details.