I recently setup a public repo, built a simple app and everything worked as expected.
Eventually I decided the repo should live under a public organization to help encourage contributions. So I created a new organization then transferred the repo to the new organization. I'm setup as the owner (and only member) of this organization.
I then updated the remote on my local using:
git remote set-url [new org repo URL]
A git remote -v displays the new org repo URL.
I made a few more edits (to update the links to the repo in the README) and did a git push origin master to push the changes to the new repo.
And got:
remote: Permission to [new org repo URL] denied to [user].
fatal: unable to access 'https://[user]@[new org repo URL]': The requested URL returned error: 403
A git pull origin master returns successfully.
I have also tried:
- Changed the default permission for members of the org to both Write and Admin
- Deleted my local repo, then cloned from the new org repo URL, then tried pushing again
- Created a team under the new org, then added the repo to that team with Admin permissions
But still get the Permission Denied issue.
What other git, repo, and/or org permissions changes do I need to make?
In your project folder,
Go to
.gitfolder and edit theconfigfile.find
url=entry under section[remote "origin"]ssh://git@[new org repo URL]Now you can do
git push origin masterand it should workEDIT
Using
sshis an alternative tohttps. You should have been asked for a GitHub username and password when you cloned your repo (assuming you usedhttps). If you have enabled two-factor authentication, or if you are accessing an organization that uses SAML single sign-on, you must provide a personal access token instead of entering your password for HTTPS Git. This error can occur if you are using an old version of git.