I have used one Github account to push an android project to Github from Android Studio. Now I have created another account on Github and want to push my another android project
I was also facing the same issue (working on same PC with diff usernames)
remote: Permission to new_username/repository_name.git denied to old_username.
Tried all solution mentioned even deleting .gitconfig didn't work.
In the end, solved by following different way :
1. Adding as Collaborator to old_username
2. Accept collaboration invitation (Make sure you are logged in to old_username)
3. Push with new_username. Done!