【问题标题】:Github for the second user: how to set up第二个用户的 Github:如何设置
【发布时间】:2018-07-19 17:10:55
【问题描述】:

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

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

git config user.name git config user.email

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

【问题讨论】:

    标签: git github github-api git-remote


    【解决方案1】:

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

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

    ssh -T github-COMPANY
    

    (使用 github-COMPANY 是您的 ~/.ssh/config 文件中的密钥,它引用您的第二个私钥,提供您将第二个公钥注册到您的第二个 GitHub 帐户)

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

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

    然后推。

    【讨论】:

      猜你喜欢
      • 2013-08-30
      • 2021-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-21
      • 1970-01-01
      • 1970-01-01
      • 2017-03-12
      相关资源
      最近更新 更多