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:
- Go to
Repository
>Admin
>Collaborators
- 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.- Select that username which will cause a green check mark to appear indicating the system recognized that username.
- 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
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.