I was using an SSH key for github for a while, I've now switched to a new account and Git is still trying to use my old SSH key. Here's what I get when trying to push:
remote: Permission to ***REPO*** denied to ***OLD USERNAME***
fatal: unable to access ***REPO***: The requested URL returned error: 403
My .gitconfig file has the correct email and name.
My ~\.ssh\config file reads as follows:
Host github.com
IdentityFile ~/.ssh/id_ed25519 ***The correct key***
IdentitiesOnly yes
I deleted the old key files.
When I run ssh-add -l, the only key listed is the correct one.
I also uninstalled and reinstalled Git.
Does anyone have any insights? Is there a global config file for ssh-agent somewhere or something? I have no idea what to do, the only next step I can think of is literally reinstalling Windows.
403is an https error code, which means you're not using ssh in the first place.