问题描述
我有两个github账户,一个用于家庭工作。我正在开展一个个人项目,并且无法推送给原始大师,因为它表示我仍然登录到我的工作账户。
我重置了我的全球用户/ user.name / user.email / user.token,它仍然注册我的工作帐户。
这不可能很难吗?
谢谢
仅用于非ssh通信。
但是,如果您使用https地址推送到GitHub,并且仍然注册为第一个而不是第二个帐户,这意味着您不会在第二个帐户中引用与您的公钥相匹配的公钥/私钥。
例如,请参阅博客文章,它通过ssh配置文件管理这些公钥/私钥:
#Default GitHub
主机github.com
主机名github.com
用户git
IdentityFile〜/ .ssh / id_rsa
主机github-COMPANY
HostName github.com
User git
IdentityFile〜/ .ssh / id_rsa_COMPANY
I have two github accounts, one for work one for home. I am working on a personal project and can't push to origin master because it says I'm still logged in to my work account.
I reset my global user / user.name / user.email / user.token and it still registers my work account.
This can't be that hard?
Thanks
The GitHub token is only used for non-ssh communications.
But if you are pushing to GitHub using https address, and still register as your first account instead of the second one, that should mean you don't refer to the right public/private keys matching your public key on second account.
See, for instance, the blog post "Quick Tip: How to Work with GitHub and Multiple Accounts", which manages those public/private keys through a ssh config file:
#Default GitHub
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
Host github-COMPANY
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_COMPANY
这篇关于更改github帐户的mac命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!