I've just created a Github organization with two repositories, but It seems that I can't push/pull/fetch to either of them. It displays this error message when I run git push -u origin master:
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Reading a bit about this problem, I've tried this so far:
- Created a new ssh key.
- Set name and email in git config:
git config --local user.email "[email protected]"
git config --local user.email "myusername"
- Created a new ssh-key and added it like this:
ssh-add ~/.ssh/my_ssh_key
- Deactivate third-party applications restrictions in the organization settings.
None of this seems to work. The project and the repositories are brand new, and I am just trying to push my initial changes to them.
git init
git add README.md
git commit -m "first commit"
git branch -M master
git remote add origin [email protected]:<organization_name>/repo_name.git
git push -u origin master # here it fails
Any idea about why is not working?
Thanks!
UPDATE: since I have multiple github accounts, running ssh -T [email protected] it displays that I am authenticated other account.
# ssh -T [email protected]
Hi MY_WRONG_ACCOUNT! You've successfully authenticated, but GitHub does not provide shell access.
So I think I need to change that account. (I thought it will change once I run ssh-add ~/.ssh/my_write_acc_key.
I would create a second key (without passphrase, for testing), and register its public key to the new account.
And create a ~/.ssh/config file to reference that second key:
From there, check your key does reference the right user with:
And change your remote URL: