I have two users on this machine. user1
is linked to my personal GitHub and user2 is linked to my work GitHub.
Setting the user with this does not work:
git config user.name "User Name"
git config user.email "UserEmail@Host"
If I check which username, user email are it reports user1, which is what I want it to be. BUT when I push it says remote: Permission to user1/repo.git denied to user2
.
I'm dying here. There has to be a simple fix for this that I'm just missing.
I remember using SSH for user2 when setting that up. I think that might have something to do with this. I'm happy to delete user2 altogether.
I found this issue, which looks the same, but the fix for it didn't work for me.