Two github accounts conflicting on the same computer

Viewed 174

I have 2 github accounts, one for personal use and one for work.

I am working on a personal website and so I have logged into git from the terminal using my personal username and password. When I do a 'git config --list' I am shown the correct username and password for my personal account as I would expect.

However when I then try and push my code up to my personal account it gives this error...

remote: Permission to <personal_username>/<personal_repo>.git denied to <work_username>.

I have no idea where it is even picking up my work username or work credentials from as they are not listed in my git config.

Please help!

Thanks

1 Answers

If the URL is an HTTPS one, check your git config credential.helper: if manager, if would have cached, you need to reject its URL

git credential-manager reject 
protocol=https
host=github.com
Related