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

How do I clone a private repo via SSH?

I manage a Ubuntu server for intranet web projects. I would like to clone a repo from that server onto my local dev environment. The project in question utilizes a PHP framework, and all requests are redirected to the public directory of the project. The .git file, however, is located in the directory above the public directory.

I've seen that GitHub allows users to clone a repo via SSH. This could be a potential fix to my problem, but the catch is that I can't upload my company's intranet sites onto GitHub. Is there a way to use SSH to clone privately managed git repos? If not, is there a workaround for cloning a repository in which the .git folder is not in the site's web root directory?

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Eric Drake! Have you taken a look yet at setting up the server specifically for use with git? If not, take a look at this documentation which explains how to set up your server to handle git repositories through SSH. The instructions here are presented with the assumption that you're running a standard Linux distribution like Ubuntu.

Hope this helps! :sparkles: