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 create a repository in a new folder from the command line?

How do I create a repository in a new folder from the command line?

1 Answer

Allison Hanna
Allison Hanna
36,222 Points

Are you referring to a git repository? Basically this, but don't just copy paste. Read the link below for a better understanding: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

git init

git add .

git commit -m "initial commit"

First navigate to the correct folder, initialize it as a git repository (git init), add some files (git add .), and then commit them (git commit -m "initial commit").

Allison Hanna
Allison Hanna
36,222 Points

Oh yeah and if you need to make the folder to begin with, type mkdir name_of_new_folder then cd into it with cd name_of_new_folder.