HappyDeveloper
HappyDeveloper

Reputation: 12805

How to keep each component from an application in a separate version control repository?

I want to keep each component of an application in a separate, independant repository, with its own versioning, so they can be distributed separately (eg: you may want to use only one or two components)

Is there a standard way to do this with mercurial or git?

I have seen something like this in symfony2, all the bundles are separate and they get updated from their respective remote repositories with a single command.

And what about nested repositories? Is that possible?

Upvotes: 0

Views: 94

Answers (2)

Tim Henigan
Tim Henigan

Reputation: 62168

With Mercurial, you are looking for Subrepos (also see the wiki link).

Each component may be a stand-alone Mercurial repo. These components can then be nested inside a "parent" repo as a subrepo.

The parent repo points to a specific revision of each subrepo, so different projects may use different versions.

Upvotes: 2

Vicente Quintans
Vicente Quintans

Reputation: 1416

With git you should have a submodule for each component.

Then, from the different applications you want to distribute you just use the correct version from each submodule you need.

This is a very generic question, you can see more about submodules and how you can use them in your setup at: http://book.git-scm.com/5_submodules.html

Upvotes: 4

Related Questions