I have a work GitHub account and a personal one. First I used the personal one for test projects, then I moved on and did a repository with the other account on the same com
I had this problem as well but none of the other solutions worked for me. It turns out that for work we had created a .netrc file that had entries for github authentication. The git command always used the .netrc, which had my old user name and password. I had to edit the entries in my .netrc file to use the new username and password.