change github account mac command line
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?
One Solution collect form web for “change github account mac command line”
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