I'm new using GitHub. I'm trying to clone my first file from a users repo. I keep receiving this error:
Permission denied (publickey).
fatal: Could not read from remote repository
When I check to verify the public key is attached to my GitHub account, by using this command:
ssh-add -1
I get this error:
The agent has no identities.
I've also tried this:
ssh-add ~/.ssh/id_rsa
in which it tells me:
Identity added
I also ensured that my laptop's SSH key was added to my GitHub account. What steps am I missing?
I've scanned the internet – I'm lost.
You can clone a github repository in 2 ways. You can choose the type while cloning the repository.
HTTPS
git clone https://github.com/flyway/flyway.git
You may need to provide username/password if it is a private repository.
SSH
git clone [email protected]:flyway/flyway.git
You need to setup ssh keys in your PC and update in your github account.
Read more about
Adding SSH Keys
Which remote URL should I use?
Try cloning repository by https link git clone https://github.com/github_user_name/repository_name
And you can add the SSH key manually into your github account.
cat ~/.ssh/id_rsa.pub
cat ~/.ssh/id_rsa.pub
. You can give some name to remember the computer name.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With