简体   繁体   English

Github第二个用户:如何设置

[英]Github for the second user: how to set up

I've tried to setup a second user for github. 我试图为github设置第二个用户。 I followed this article, created SSH key, tied it to my github.com accound and added remote origin. 我遵循本文,创建了SSH密钥,将其绑定到我的github.com accound上,并添加了远程源。

How do I proceed from this moment on? 从现在开始我该如何进行? When I use 当我使用

git config user.name git config user.email

commands it still dispays the 1st account's data. 命令仍然会支付第一个帐户的数据。

user.name/email have nothing to do with authentication. user.name/email与身份验证无关。 Only with commit authorship. 仅具有提交作者身份。

Check if your second key is cirrectly recognized by GitHub: 检查您的第二个密钥是否被GitHub正确识别:

ssh -T github-COMPANY

(with github-COMPANY the key in your ~/.ssh/config file, which references your second private key, provided your registered your second public key to your second GitHub account) (使用github-COMPANY,〜/ .ssh / config文件中的密钥,该密钥引用您的第二个私钥,前提是您已将第二个公钥注册到了第二个GitHub帐户)

If this works (you get a Welcome message), then in your second local repo, use that URL: 如果这可行(收到欢迎消息),则在第二个本地存储库中,使用该URL:

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

And push. 并推。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM