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 know this might be a little late, but I was stuck with this for quite some time and finally fixed it like this:
Go into keychain access (osX)
search git (make sure you have selected All Items)
Hope this helps!
I had the same problem. It turns out I had two accounts on GitHub using the same SSH key and GitHub defaulted to using the wrong account that did not have permission to the repo I was after. I removed the SSH key from the account I did not to use all worked as expected.
You can test which account GitHub is authenticating yourself with:
ssh -T git@github.com
For me, this originally showed the wrong username, but after removing the duplicate SSH key from that account, it then showed the correct username and my pull and push to my repo worked well.
I got the same issue. Below is what happen in my case:
I previously made git to not ask my credential every time I talk with remote repository by this: git config --global credential.helper wincred
I resolved the issue by running the same command with "none" replacing "wincred" git config --global credential.helper none
Then git ask my username/pass again and everything go well