Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby

git clone generating errors

My Treebook directory on my computer was somehow deleted and I want to clone the latest version from github. However, I am running into two errors.

I open terminal and type: git clone git@github.com:ercgnclvs/treebook.git

and terminal returns:

Cloning into 'treebook'...

Permission denied (publickey).

fatal: The remote end hung up unexpectedly

Thank you

3 Answers

Jim Hoskins
STAFF
Jim Hoskins
Treehouse Guest Teacher

It looks like you haven't set up your keys to use github via ssh.

Their guide provides great information on how to do that https://help.github.com/articles/generating-ssh-keys

James Barnett
James Barnett
39,199 Points

@Devon -

Quoted from the other thread where this was previously covered


Jim has already setup his git with an SSH key, it's not necessary for you to do that.

The easy way to clone treebook is to use:

git clone https://github.com/jasonseifer/treebook.git

I also wanted to note that Github recommend using the https method.

Jim Hoskins
STAFF
Jim Hoskins
Treehouse Guest Teacher

Good point James.

If you're comfortable with using the https method go for it. To be honest, I wasn't even aware of the https features of github when we recorded that, since I've been using SSH keys for years.

It's a trade-off if you want to use ssh or https as your git protocol. For instance my github password is managed through my password manager, so I can't type it into the console, because I don't know it, nor do I want to enter my password regularly anyway. SSH is easier in the long run, once you get the keys set up, which is a little bit of work.