问题
today I've moved my private github repository to newly created organization (of which I'm an owner). I've changed my remote origin to git@github.com:organization/repo.git. I'm not able to push to remote because I've got an error saying
Error: Permission to organization/repo.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 checked that my account is owner of organization and repository exists.
回答1:
I managed to find an answer. Maybe I did something wrong, or maybe it was because of github issues, but even if I was stated as an owner of Organization I had only rights to read repository. I couldn't change permission for myself because "you can't change permission for owner". I changed permissions for all members to admin, and because for now I'm the only one member of organization it's not a big deal.
回答2:
Using GitHub Desktop..I was having a weird bug where I was owner of the organization, and admin of the repo(I had full rights) on my organization's repo. I decided to go into the command line, and push from there (Type "git push") and that fixed it! It pushed, and I could now push from GitHub Desktop again. Weird, but hope it helps someone!
来源:https://stackoverflow.com/questions/52936638/owner-cant-push-to-organization-repository