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:
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 .git
folder and edit the config
file.
find url=
entry under section [remote "origin"]
ssh://git@[new org repo URL]
Now you can do git push origin master
and it should work
EDIT
Using ssh
is an alternative to https
. You should have been asked for a GitHub username and password when you cloned your repo (assuming you used https
). 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.