Skip to content

Instantly share code, notes, and snippets.

@kosyfrances
Created June 15, 2016 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kosyfrances/ea0c97722dfd34e4c9d460e70b282b43 to your computer and use it in GitHub Desktop.
Save kosyfrances/ea0c97722dfd34e4c9d460e70b282b43 to your computer and use it in GitHub Desktop.
Pushing to Git returned error 403 with old git username instead of new

When I tried to push to Github, it gave me this error.

remote: Permission to NEWUSER/NEWREPO.git denied to OLDUSER. 
fatal: unable to access ‘https://github.com/NEWUSER/NEWREPO.git/': The requested URL returned error: 403

But setting the user.name and email globally should have fixed it, No it did not. So I got it fixed by deleting the OLDUSER associated with GitHub from Keychain Access app under Passwords section. Then the push command went successful. :)

@jainrocks999
Copy link

this problem are coming in my push code please solve it

@itsmeashutosh43
Copy link

I had a similar error. It was solved when I forked the repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment