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


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
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
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.