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

General Discussion

Louis Sankey
Louis Sankey
22,595 Points

Moving Treehouse projects to Git repositories.

I have made it through the 'merging' section of the Git Hub tutorial. I am at the place where I should have everything I need to start using Git to keep track of changes to my work. The only problem is that I am having trouble tying what I've learned together. I figured that a good place to start would be to commit the files of one of the Treehouse projects that I have already worked on. I created a new repository with the name and location that I want. I go into the repository in my terminal and that is where I get confused. Should I use the "git add" command and somehow add each file individually? That doesn't seem right to me because I am not in the folder with the files that I want to add. Can I directly change a working directory to a git repository? I will continue to investigate this on my own, but I thought I would post the question in case nothing turns up. Thanks a lot in advance.

2 Answers

Patrick Serrano
Patrick Serrano
13,834 Points

You want to cd into the directory of the project, initialize a repository in that directory, and then you can git add . the contents of that directory to the repo, and finally make your first commit.

Louis Sankey
Louis Sankey
22,595 Points

Awesome, that was quick. Thanks a lot for the help!