ERROR: Permission to user1/repo.git denied to user2

I was stupid and didn't add them as collaborators.

To do this, follow these instructions:

  1. Go to Repository > Admin > Collaborators
  2. You will see a text box with a Add button. In order to add a collaborator you start typing in the text box until you see the actual username suggested to you in the drop down list that appears as you type.
  3. Select that username which will cause a green check mark to appear indicating the system recognized that username.
  4. Press Add to add that collaborator to the repository.

You can also watch this octocast: http://screencast.com/t/m7yN19N4645h


The problem comes from Windows Credential Manager, and you just need to delete the git account there:

Control Panel——>User Account and family Safety——>Manage Windows Credential——>remove the github account

Windows Credentials


You first need to remove the last ssh connection.

To remove the last ssh connection, follow this command:

ssh-add -D

then try to push.