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

Leave a Comment