4

When I use Git, I usually use the command line. so to push changes to the server. I add the public key to the SSH session using:

$ eval "$(ssh-agent -s)"
ssh-add "D:/Dev/Books Spaces/Version Control with Git and GitHub/SSH/key"
Enter passphrase for D:/Dev/Books Spaces/Version Control with Git and GitHub/SSH/key:
Identity added: D:/Dev/Books Spaces/Version Control with Git and GitHub/SSH/key (me*****d@outlook.com)

Now I would like to use intellij using SSH. How Can I add the private key to intellij? Right now it prints the message: enter image description here

usertest
  • 2,140
  • 4
  • 32
  • 51

1 Answers1

6

Since you ssh key is not a standard one (in %USERPROFILE%\.ssh\id_rsa), you would need to make a %USERPROFILE%\.ssh\config file in order to reference said key

Host github
  Hostname github.com
  User git
  IdentityFile "D:/Dev/Books Spaces/Version Control with Git and GitHub/SSH/key"

Then try the origin remote URL github:xxxx/tacos01.git

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks that worked. do you have a link to article on this I would like to read more on this. – usertest Mar 10 '20 at 09:41
  • @usertest Great! I remember using that back in 2012 (https://stackoverflow.com/a/12066973/6309). All the parameters of an SSH config file are described in https://www.ssh.com/ssh/config. Examples: https://www.cyberciti.biz/faq/create-ssh-config-file-on-linux-unix/ – VonC Mar 10 '20 at 09:49