同一个 RStudio 中的两个不同 Github 帐户

ARA*_*RAT 5 github ssh-keys rstudio

我可以为不同的 GitHub 帐户管理多个 SSH 密钥,以便我可以访问多个帐户和项目,每个帐户和项目都具有不同的凭据。但是,我是否可以在同一个 RStudio 中在两个不同的 github 帐户(推和拉)上处理两个不同的项目?我在网上搜索,但找不到答案。我的文件夹中有相关的 SSH 密钥。但是,我无法在 RStudio 的全局选项中更改 SSH RSA 密钥,因为它总是将~/.ssh/id_rsa. 但是我的另一个 Github 帐户也有另一个密钥~/.ssh/id_rsa_SECOND。我将不胜感激任何帮助!谢谢!

编辑:我的配置文件有,

Host me.github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile Clone  ~/.ssh/id_rsa

Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_SECOND
Run Code Online (Sandbox Code Playgroud)

这告诉我使用 me.github.com 而不是 github.com 作为第一个 Github 帐户(身份为 ~/.ssh/id_rsa)中存储库的主机,并使用 github.com 作为第二个 Github 帐户中的存储库(身份为~/.ssh/id_rsa_SECOND)。但是,当我在我的个人帐户中克隆存储库时,使用git@ **me**.github.com:username/hugo-academic.git不起作用。

小智 0

根据Microsoft 的 Windows Credential Manager文档,检查useHttpPath设置(您的 credential.namespace 可能有所不同。在我的例子中是 github.com):

git config --global credential.github.com.useHttpPath true
Run Code Online (Sandbox Code Playgroud)