IntelliJ-如何使用其他ssh密钥

问题描述

| 我有2个github帐户 公司和个人 我使用cygwin管理我的ssh密钥并连接到Github 使用公司帐户时,在IntelliJ中一切正常,因为它使用认的.ssh / id_rsa密钥 在Cygwin中,使用我的个人帐户,一切都可以正常工作,因为我可以使用\“ ssh-add〜/ .ssh / ide_rsa_otherkeyfile \”命令,然后通过命令行使用所有git命令 但是IntelliJ始终认使用\“ id_rsa \”文件,因此我无法连接到我的个人存储库。 IntelliJ是否可以使用其他rsa密钥? 所有这些RSA和cygwin都超出了我的Linux命令行经验水平。 注意: 我还在.ssh目录中创建了配置文件,以方便使用多个github帐户
Default GitHub user (corporate account) 
Host github.com HostName
github.com User git IdentityFile/Users/username/.ssh/id_rsa

Client user (personal account)
Host github-client
HostName github.com
User git IdentityFile /Users/username/.ssh/id_rsa_perso
简而言之,这是告诉SSH在连接到服务器github-client(实际上是github.com)时使用客户端密钥。 如果没有人提供解决方案,我知道邀请我的公司帐户作为贡献者会更容易,但是我将在2个单独的电子邮件帐户下进行提交。     

解决方法

        从版本控制系统中签出项目时,请使用VonC所述的“ 1”格式。
$ cat ~/.ssh/config
Host github.com-activehacker
    HostName github.com
    User git
    IdentityFile /Users/andrey/.ssh/id_rsa_activehacker
    ,        从“使用Git集成”:   IntelliJ IDEA支持使用多个ssh密钥的标准方法,   通过创建.ssh / config文件。