Git returning Error 403 while pushing the code

You may check for the Git Credentials you are using, and change that with your new account.

As the top answer from the question you mentioned says, using a SSH way by

$ git remote set-url origin [email protected]:new_user/new_repo.git

(and set the SSH Key) instead of HTTPS way is also a workaround.


This happens when two git accounts are being used on same machine. On Windows 7 you need to remove git Credentials from Windows vault.

  • go to Control Panel -> User Accounts -> Manage your credentials.
  • Under Generic Credentials delete entries for github credentials.
  • Try to push code and this time it will prompt you for correct username and password again.

enter image description here

Tags:

Git

Github