0

I'm pretty new to Github and I have one question I couldn't really find a clear answer for it.

Let's say I have a project called "Practice". In this project I would like to create different web components and practice my skills. Should I group all the components inside a single repo called "practice-components" (github.com/username/practice-components/...) or create a different repo for each new component I'm creating (github.com/username/component-1, github.com/username/component-2, etc.).

I'm not really sure what's considered "good practice" between the two methods.

0

2 Answers 2

0

It is far more common for a repository to match up at the project or solution level. That said, nothing is forcing you to have more than one component in each one. It's just going to add overhead that you may find cumbersome. Before doing this be sure you're going to get something worthwhile out of it.

If your planning on sharing this work with others understand that their expectation is going to be that cloning one repository is enough to get something that works. Complicated instructions that insist you must also clone this that and the other will make people think you just need to learn a package management tool.

0

A repo is a collection of related files (a library, website, desktop application, mobile app, etc). "Related" is of course dependent on a whole bunch of things, including the project and user / company. Regardless of what it encompasses, it should be sufficiently scoped so that cloning the repo is enough to build everything and have it work. If bits and pieces are spread out among several different repos, many tools can have one repo reference another (e.g., Git Submodules) to facilitate this.

In your case, since this is purely practice, try it both ways - I don't think there is any "best practice" on practice repos. See which works better, if any, and what the benefits and downsides to both are. One thing to keep in mind is that big repos tend to have longer build times (sometimes painfully so). Not sure how many "components" you'll be practicing on so it may not be an issue here.

Not the answer you're looking for? Browse other questions tagged or ask your own question.