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 Git Basics Working With Remote Repositories Cloning

Patrick O'Dacre
Patrick O'Dacre
15,471 Points

Cloning on my machine using a relative file path?

In the video the clone is completed by using the ~/my... pathing.

I would like to clone using relative pathing when the path is long.

I tried this when I was in the main repo I wanted to clone:

git clone ../current_folder ../new_folder

both folders are in the same parent folder.

Just want to make sure this is correct. I don't think it is since I get different results when trying to push.

Thanks

2 Answers

Your syntax should work as stated to clone current_folder into new_folder. You could also use a single period to refer to the current directory, for example:

git clone . ../new_folder

What result were you expecting when you tried to push, and what happened instead?

Patrick O'Dacre
Patrick O'Dacre
15,471 Points

Hi Sara and thanks.

I got it to work last night.

I went ahead of the video and tried following a git instruction to set the upstream pathing... and that messed things up. I don't have the exact details.

The lesson is don't work ahead of the video unless you're really sure of what you're doing.

Ha! Glad you got it figured out. (: