更改github帐户的mac命令行 [英] change github account mac command line

查看:114
本文介绍了更改github帐户的mac命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个github账户,一个用于家庭工作。我正在开展一个个人项目,并且无法推送给原始大师,因为它表示我仍然登录到我的工作账户。

我重置了我的全球用户/ user.name / user.email / user.token,它仍然注册我的工作帐户。



这不可能很难吗?

谢谢

解决方案

GitHub token 仅用于非ssh通信。



但是,如果您使用https地址推送到GitHub,并且仍然注册为第一个而不是第二个帐户,这意味着您不会在第二个帐户中引用与您的公钥相匹配的公钥/私钥。

例如,请参阅博客文章快速提示:如何使用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命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆