You do not have permission to push to on Github. Would you like to create a fork and push to it instead

Viewed 1288

I am using visual studio code. I create a repository with one single file. But the file is not uploading with one warning stated as "You do not have permission to push to on Github. Would you like to create a fork and push to it instead" Below a screenshot of the warning: enter image description here

I have latest version of everything (git,VS Code)

2 Answers

I had the same issue and I managed to solve it by doing the following:

  • In VScode sign out by clicking on the person icon on the left down on the screen and close VScode.
  • After this go to your "Control Panel" in "Windows OS and search for " Credential Manager" and choose "Windows Credentials".
  • Below you will see a list called "Generic Credentials", remove everything with the name "Git" and "Github". (this will remove your logins)

After all these steps, go back to VScode, login by clicking on the person Icon. When you click on publish, github will asks you to login in again and authorize. After this the error message was gone for me.

it can be caused because of your github account in VS-Code or because of your role in the project.In my case, I loged out in vs code and loged in again by right account.

Related