0

on my terminal I do :

git clone git@github.{myGithubUsername}/{my-repo-name}

in order to clone a repo I've created on my personal GitHub account.

I've opted to clone using SSH.

I get :

ERROR: Repository not found.
fatal: Could not read from remote repository.

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

I understand there's smth wrong with the SSH authentication but at no point am I asked to validate anything SSH related.

NOTE: I already have an SSH key on my machine, which I've copied on GitHub and I'm using in order to work on repos of another user.

I thought I might need to create a new separate SSH key in order to work on my own personal repo but when i try to create a new SSH key on machine it says it will have to overwrite the existing one. So I'm guessing (?) I can use the existing SSH key for multuple repos (my own ones and those of others).

Still I don't know how to link this personal repo of mine with that existing SSH key in order to be able to clone it.

Kawd
  • 4,122
  • 10
  • 37
  • 68
  • Does normal cloning over HTPPS work? Is 2FA turned on? – Drwalcore Apr 28 '17 at 12:05
  • 1
    Make sure that contents of `~/.ssh/id_rsa.pub` in your machine and ssh key in your github profile are same. – acsrujan Apr 28 '17 at 12:05
  • 1. the contets of the file are the same because I'm already using this key with a repo of another user and it's working fine, 2. cloning over HTTPS does not work either 3. yes, I have 2FA turned on – Kawd Apr 28 '17 at 12:16

1 Answers1

1

You're missing the .com: part.

The right syntax is: git clone git@github.com:{myGithubUsername}/{my-repo-name}

If it still doesn't work, consider executing this first:

ssh-add ~/.ssh/{you_key_name_here}
eval `ssh-agent`
yoones
  • 2,394
  • 1
  • 16
  • 20
  • Yes I forgot to add it in the original post, I'm using the correct syntax in the terminal though. What is `{your_key_name_here }` ? – Kawd Apr 28 '17 at 13:25
  • 1
    Look in the directory `~/.ssh` to find the name of your ssh key (it usually looks like `id_rsa`) – yoones Apr 28 '17 at 13:27