目前我正在使用GitLab作为我的远程GIT服务器。
我可以使用单个带有SSH密钥的Gitlab账户,没有问题。
但是现在我申请了另一个Gitlab账户,我想尝试使用相同的SSH密钥,但是我无法将该密钥添加到此新账户中。
当我尝试添加密钥时,错误如下:
已经拥有该密钥
指纹已经被占用
那么我应该如何使用相同的密钥访问第二个Gitlab账户? 如果不可能,我应该如何同时使用两个密钥。
顺便说一下,我正在使用Windows系统。
提前感谢!!
更新
下面是我的配置文件。它如下所示:
#my primary account
Host {account1}
User git
HostName gitlab.com
PreferredAuthentications publickey
IdentityFile C:/Users/{username}/.ssh/id_rsa1
#for NPR_HPTG account
Host {account2}
User git
HostName gitlab.com
PreferredAuthentications publickey
IdentityFile C:/Users/{username}/.ssh/id_rsa2
我有两个Gitlab账户,
git@gitlab.com:{account_1}/repo1.git
git@gitlab.com:{account_2}/repo1.git
但是,我无法访问account_2
。
在拥有第二个GitLab帐户之前,我只需将ssh
密钥上传到account1
而不需要设置这个。但现在按照此方法操作后,最终我仍然无法推送到git@gitlab.com:{account_2}/repo1.git
。我正在使用TortoiseGit
进行推送/拉取。