Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Natasha McDiarmid
Natasha McDiarmid
11,400 Points

Cloning from GitHub

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.

So I try adding 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.

2 Answers

Natasha McDiarmid
Natasha McDiarmid
11,400 Points

I figured this out. I was cloning it incorrectly.

I was doing:

git clone [filepathhere]

When I needed to include my username, like this:

git clone [username@filepathhere]
Sander de Wijs
PLUS
Sander de Wijs
Courses Plus Student 22,267 Points

You write that you have tried to clone a file from the remote repository. Is this what you tried do do exactly, or did you mean you wanted to clone the whole repo?

Normaly you would clone the entire repo, and start working on the desired files on your own PC. Maybe that's the reason for the error.

What command did you use to clone the remote repository?