opensas
opensas

Reputation: 63395

How do I organize my git repos when having multiple applications?

I have a system composed of several components that I'd like to have under source control and I'd like to know the pros/cons of different aproaches I might take.

This is the situation

The easiest thing would be to keep everything under the same repo (most common scenario is that I have to modify them all if, for example, I have to add a field to a table).

I don't find many advantages to keep everything in different repos, but I've seen a couple of applications organized that way, so I guess I must be missing something...

Upvotes: 0

Views: 1303

Answers (1)

merlin2011
merlin2011

Reputation: 75545

The only advantage I am aware of for having multiple repositories for tightly coupled projects is if you expect them to be used independently and believe that cloning everything will be expensive if you have a single repository. Some people will claim that having independent histories is useful, but I've never found that to be useful after doing it for a while. I have found it to cause problems when you try to do git bisect-style debugging across multiple repositories.

If you go with multiple repositories for the above reason but must still frequently work with them together, then I'd recommend creating a super-repository that has all the others as submodules. That way, you can at least have snapshots in the history of the super-repository when each of the parts was consistent with the others.

If the common case is that the projects are used and modified together, then they should be in one repository. Many of the large tech companies I have worked at keep almost all of their code in one giant repository or a few large repositories.

Upvotes: 1

Related Questions