Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Git repositories for each Eclipse project or one Git repository

I am in the process of moving to Git from SVN. In SVN I had multiple eclipse projects in a single SVN repository that is convenient for browsing projects. I was going to move to having one git repository per eclipse project but EGit suggests doing otherwise.

The guide for EGit suggests putting multiple projects into a single Git repository.

Looking at similar questions such as this suggest one project per repository.

Which approach is best practice and what do people implement?

like image 599
Codey McCodeface Avatar asked Jul 18 '12 12:07

Codey McCodeface


People also ask

When should I use multiple repositories?

With Git, using multiple repositories is the only way to work efficiently. This enables each team to work independently, and do their work faster. You can also make sure that developers only have access to the repositories they need access to (thus making Git more secure.)

Can a project have multiple repositories?

It is a combination of two Git tools that you can use to manage multiple repositories within one project. The two tools are HelixTeamHub and Helix4Git Do. Here, HelixTeamHub lets you work with multiple repositories, whereas the developers can use Helix4Git to contribute to the sub-projects or repositories.

Can GitHub project have multiple repositories?

Manage all of your GitHub repositories together. We're super excited to announce support for multiple repositories. You can now manage multiple GitHub repositories under a single project, and since we've also reworked sprints, the Issue Manager, and Tickets, the benefits are huge!

How many Git repositories can I have?

Theoretically, everyone can has an unlimited number of public and private repositories even as part of a free plan. Public repositories don't have officially any restrictions even as part of a free plan.


1 Answers

It depends on how closely-related these projects are. Ask yourself the following questions:

  • Will they always need to be branched/tagged together?
  • Will you want to commit over all projects, or does a commit mostly only touch one project?
  • Does the build system operate on all of them or do they have a boundary there?

If you put them all in one, some things from above will be easier. You will only have to branch/tag/stash/commit in one repository, as opposed to doing it for every repository separately.

But if you need to have e.g. separate release cycles for the projects, then it's necessary to have each project in an independent repository.

Note that you can always split up a repository later, or combine multiple repositories into one again without losing history.

Combining is a bit harder to do than splitting, so I would go for one repository first and see how it goes.

like image 59
robinst Avatar answered Sep 20 '22 00:09

robinst