How to organize projects on a Git server?

I am new to Git and I am transitioning from SVN. I am working on creating a new Git server for my team. I am trying to figure out how best to set up projects on a Git server.

Is every project I want to fork out and tag its own repo in Git? . In SVN, it will usually be its own folder in the central SVN repository. Git seems to prefer the project with its isolated repository.

If I understand correctly that each project is a new repository in Git, how are things grouped? In SVN, different teams can have an SVN repo section with their projects in this section. Examples, perhaps a grouping of all front-end projects in one folder and all services in another. Is this done in Git, calling te repo a prefix, or is there a concept for folders or groups?

Thanks for the help!

+4
source share
2 answers

Each project ideally represents its own repository. You can, of course, create a megalithic storage of everything, but this is not optimal.

I prefer to create repositories in folders and use git submodule to bring libraries or dependencies to top-level projects. Submodule is a great way for a version that uses iteration of an external repository.

+2
source

Firstly, git is complicated, but using github.com is a great way to understand its strengths and learn some of its best practices. This is the site I used during training, and it has good documentation on git workflow, tricks, etc. I recommend it as a way to go beyond the concepts that svn may have instilled, which is no longer applicable.

Regarding the organization of the repo between the teams, everything that matters most in the folder on any server equally applies to git, since git will essentially duplicate the entire folder that is the root of the repository at any time.

What can help is that different teams work in different industries and often cancel and often enter a stable central branch. I am currently using the main branch for production-ready code, the dev branch for potentially unstable code that deserves sharing and testing, but should not go live and local branches when I think of a new function that I can try.

+2
source

Source: https://habr.com/ru/post/1342541/


All Articles