-1

I am trying to clone a locally existing repo to github. They suggest doing this:

$ git remote add origin git@github.com:Retr0MrWave/MathTiles.git
$ git push -u origin master

but when I try to do this an error pops up (after the second command):

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

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

Is there a way to fix this?

MrWave
  • 35
  • 1
  • 6
  • 1
    I'm assuming the repo is private as when I try to access https://github.com/Retr0MrWave/MathTiles I get a 404. – evolutionxbox Feb 13 '20 at 16:15
  • 1
    Does this answer your question? [GitHub Error Message - Permission denied (publickey)](https://stackoverflow.com/questions/12940626/github-error-message-permission-denied-publickey) – phd Feb 13 '20 at 16:21
  • https://stackoverflow.com/search?q=%5Bgit%5D+Permission+denied+publickey – phd Feb 13 '20 at 16:21

2 Answers2

1

It looks to me like your credentials for GitHub aren't configured correctly. Have you followed this guide Creating a personal access token for the command line?

BarakStout
  • 61
  • 1
  • 2
0

try verify remote repository

$ git remote -v 

before push existing repo.