Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Someone I know is trying to clone my github repo and make changes directly to it. It's a public repo. He's cloned it with my read-write access link and he can pull from the repo. The problem is when he tries to push anything he gets the error

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

Where he's user2 and I'm user1. I've allowed other people to use different repos before and I've never had this problem. Am I missing something to allow him access or did github change? I've seen this on the help page for github:

This error occurs when you attach your key as a deploy key on repo1. You can push and pull from that repo without issue, but you won’t have access to any other repo with your key. To solve this, remove the key from repo1’s deploy keys and attach it on your account page instead. This key will now have access to all repos your account has access to.

We haven't messed with the deploy keys, but I can't find any other solution on the web.

like image 637
gsingh2011 Avatar asked Mar 07 '12 19:03

gsingh2011


People also ask

How do I know if I have access to Git repository?

how can i check write access to a git repository, if i do have a clone of it? A very easy way to check is whether you see an edit 'pencil' icon in the top right of the README.MD on the main Code page of the repo (scroll down to it if there's a long list of top level files/folders).

How do I remove a deploy key?

Under your repository name, click Settings. In the "Security" section of the sidebar, click Deploy keys. On the Deploy keys page, take note of the deploy keys associated with your account. For those that you don't recognize, or that are out-of-date, click Delete.


1 Answers

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

like image 97
gsingh2011 Avatar answered Sep 21 '22 19:09

gsingh2011