1

I'm trying a 'git push'

I'm very new to Github and have managed to run git clone and get the directory onto my Mac and I've made changes to a readme file (to test things) and then ran a

git commit -a -m "Changes to readme file"
git push

But get this message:

ERROR: Write access to repository not granted. fatal: Could not read from remote repository.

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

I've Googled this error and tried a few of the suggestions with no success. If I run this it looks ok: ssh -T [email protected]

I get:

Hi joebloggs! You've successfully authenticated, but GitHub does not provide shell access.

Any ideas what I'm doing wrong here? Thanks

Gonzo
  • 11
  • 5

1 Answers1

0

Check first if you are actually using an SSH URL

cd /path/to/repo
git remote -v

If it starts with HTTPS, then your SSH key would be irrelevant.

Second, make sure you have cloned a repository you have created, under your GitHub user account.
Cloning a public repository you have not created is possible (since it is "public"), but that does not give you the right to push back to it. For that, you would need to fork the repository first, before cloning it.
See also "Are Git forks actually Git clones?".

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250