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

When I run git init in a folder, is a git repo created within every subfolder also? Or do I need to init in those also?

When I run git init in a folder, is a git repo created within every subfolder also? Or do I need to init in those also?

1 Answer

Kevin S
seal-mask
.a{fill-rule:evenodd;}techdegree
Kevin S
Data Analysis Techdegree Student 15,862 Points

Nope! You are all good once you do git init. It basically takes that entire folder (and all of its subdirectories) and turns it into a repository. So if you had a folder called "myproject", and inside that folder you had three other folders, and inside those folders you had two folders and so on, All you would have to do is navigate to that top-level "myproject" directory, and do git init.

Then everything inside of that folder would "be seen by git" meaning that they could be potentially staged and committed to the repository.