git - 错误 : Permission to user1/repo. git 拒绝用户 2

标签 git github ssh-keys permission-denied

我认识的人试图克隆我的 github 存储库并直接对其进行更改。这是一个公共(public) repo 。他用我的读写访问链接克隆了它,他可以从 repo 中提取。问题是当他试图 push 任何他得到的错误

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

他是 user2,我是 user1。我以前允许其他人使用不同的 repo 协议(protocol),但我从来没有遇到过这个问题。我是否遗漏了允许他访问的内容或 github 是否发生了变化?我在 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.

我们没有弄乱部署 key ,但我在网上找不到任何其他解决方案。

最佳答案

我很蠢,没有加他们为合作者。

为此,请按照以下说明操作:

  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.

您还可以观看这个八月播客:http://screencast.com/t/m7yN19N4645h

关于git - 错误 : Permission to user1/repo. git 拒绝用户 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9607952/

相关文章:

Git - 使 protected 功能分支与主分支同步

git - 从远程 git 分支中 pull 代码,当它在本地不存在时

Git:为什么必须在不存在/空目录中进行克隆?

git - jenkins Nexus Artifact uploader 400

git - 撤消 master 分支中的cherry-pick

java - Android Showcase View怎么用?

ubuntu - SSH 无法向 git@github.com 进行身份验证

git - 将 git 用于具有很多很多 repos 的项目

ssh - 批量获取SSH握手过程中的数据包

maven-2 - Maven Wagon 插件可以为 scp 使用私钥吗?