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 GitHub Basics Working By Yourself Push Your Project to GitHub

Best Practice for Multiple files in GitHub

Hey everyone! I had a question. I just started using github on a regular basis. I wanted to know if you need to make separate "Git repositories" for each file/project or was there a way you can do multiple at one time. This is because from college and projects up here have lead me to have many different projects/files.

Also what is the best practice for this

1 Answer

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

Generally speaking, the best practice is to keep things simple and avoid pollution in the git commit logs, you should create one git repo for each project, unless there's a reason not to do so. For instance, check out this github repo, that is a Rails app, within it, there're 180 mini web projects written in HTML/CSS/javascript, together they form this personal site. Technically speaking, each of the 180 mini-sites can be considered entity of its own, and maybe extract out into 180 git repos, but since they're related in a meaningful way and serve as building block of a much larger complete webpage. It makes sense to group them into one git repo.