简体   繁体   English

无法推送到组织存储库,我是所有者

[英]Can't push to organization repository and I'm the owner

I just converted one of my GitHub pages to an organization and made my personal GitHub username the owner of this organization.我刚刚将我的 GitHub 页面之一转换为一个组织,并将我的个人 GitHub 用户名设为该组织的所有者。 However, I still can't write changes to the GitHub repository.但是,我仍然无法将更改写入 GitHub 存储库。 I noticed that the suggested solution here Owner can't push to organization repository mentioned that he changed permissions for all users from Read to Admin.我注意到此处建议的解决方案Owner can't push to organization repository提到他将所有用户的权限从读取更改为管理员。

I don't want to do this, so I'm not quite sure if there's an actual workaround.我不想这样做,所以我不太确定是否有实际的解决方法。 It seems that the owner should always have read/write permissions.似乎所有者应该始终具有读/写权限。

Here's my .git/config :这是我的.git/config

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = git@github.com:my-org-repo/leprechaun.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master

And here's the error that I'm getting when trying to push to it:这是我在尝试推送时遇到的错误:

[root:kali:~/scripts/leprechaun]# git push origin master
ERROR: Permission to [obfuscated]/leprechaun.git denied to MyGitHubUsername.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I've ensured that I can clone with no problems using the SSH URL, so I'm not quite sure what's going on.我已经确保我可以使用 SSH URL 毫无问题地克隆,所以我不太确定发生了什么。

Command Output Examples命令 Output 示例

[root:kali:~/scripts/leprechaun]# ssh -T git@github.com
Hi [myuername]! You've successfully authenticated, but GitHub does not provide shell access.

EDIT: Please Make sure that this solution is only tested in Linux.编辑:请确保此解决方案仅在 Linux 中经过测试。
I am not sure what happened for me but here is how i fixed it!我不确定我发生了什么,但这是我修复它的方法!


1st step:第一步:
using terminal navigate to the project folder you are trying to use push with使用终端导航到您尝试使用推送的项目文件夹

2nd step:第二步:
run:跑步:

ssh -T git@github.com Blockquote ssh -T git@github.com Blockquote

you should get a response like this:你应该得到这样的回应:

git@github.com: Permission denied (publickey). git@github.com:权限被拒绝(公钥)。 Blockquote块引用

3rd step:第三步:
using ssh-add add your owner ssh key to ssh agent使用 ssh-add 将您的所有者 ssh 密钥添加到 ssh 代理

ssh-add ~/.ssh/SOMEFOLDER/SOMESSHKEY. ssh-add ~/.ssh/SOMEFOLDER/SOMESSHKEY。

Unlock key with your passphrase and the identity will be added, what remains then is to verify that you can connect using ssh, so try again with 2nd step使用您的密码解锁密钥并添加身份,剩下的就是验证您是否可以使用 ssh 进行连接,因此请使用第二步重试

if you receive a message like this:如果您收到这样的消息:

Hi {YOUR OWNER USERNAME HERE}, You've successfully authenticated. {YOUR OWNER USERNAME HERE},您好,您已成功通过身份验证。 but GitHub does not provide shell access.但是GitHub不提供shell访问。

Congratulations.!恭喜! you can push commits now without much of a problem.您现在可以毫无问题地推送提交。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM