Github 第二个用户:如何设置

Github for the second user: how to set up

我已经尝试为 github 设置第二个用户。我按照 this 文章创建了 SSH 密钥,将其绑定到我的 github.com 帐户并添加了远程来源。

从现在开始我该如何进行?当我使用

git config user.name git config user.email

命令它仍然显示第一个帐户的数据。

user.name/email 与身份验证无关。仅具有提交作者身份。

检查您的第二个密钥是否被 GitHub 正确识别:

ssh -T github-COMPANY

(使用 github-COMPANY ~/.ssh/config 文件中的密钥,该文件引用了您的第二个私钥,前提是您注册了第二个 public 密钥到第二个 GitHub帐号)

如果这有效(您收到欢迎消息),那么在您的第二个本地存储库中,使用 URL:

git remote set-url origin github-COMPANY:<secondUser>/<secondRepo>

然后推送。