I have two Github accounts (I know this is kind of dumb, but it's company policy):
UserA is my work account, and I authenticate using my pubkey on my work machine.
UserB is my personal account, and want to push to a private repo from my work machine, using my personal username/password as credentials (as opposed to a pubkey).
However, when I try to push to a private repo on a UserB account from my work machine, I get a permissions error:
ERROR: Permission to <UserB>/<new repo>.git denied to <UserA>.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The new repo definitely exists on Github.
As other posts have suggested, I have tried git push <UserB>@github.com:<UserB>/<new repo>.git master:master, but I get a similar error: Permission denied (publickey).
How do I force git to authenticate as UserB on push without adding the SSh key from my work machine to the UserB account??