Matt V.
Matt V.

Reputation: 9809

sharing code between separate projects/repos?

I have been working on a project locally using a git repo cloned from svn using git-svn. I now need to add in some code from a different svn repo. The code is modular, so the new code will be in a new subdirectory that does not overlap the existing code. I use git-svn on my local development environment, the staging server is an svn checkout, and the live server is an svn export.

For some context, I'm working on two separate Drupal sites, each with their own svn repo. Site A has some custom modules that now need to be added to Site B. What is the best way to manage the separate sites & repos?

It seems like I may be better off setting up a third separate svn repo that contains modules that are shared between sites. If so, what is the best way to work with two separate repos in a single project?

EDIT: I'm especially interested in how others handle version control when mixing Drupal contributed modules with custom modules, across multiple sites. How might I improve on the setup described in the last sentence of the first paragraph?

Upvotes: 3

Views: 476

Answers (2)

Sean C.
Sean C.

Reputation: 191

Are you using Drupal 6's multisite capability? For my development, I have the modules that I use for every website in sites/all/modules, and the unique modules for each project in sites/example1.com/modules, sites/example2.com/modules, and so on, with a git repository for each subdirectory.

I also have the patch at http://drupal.org/node/231298 installed on the development machine, which backports a feature from D7 that makes things even smoother.

Upvotes: 1

Trevor
Trevor

Reputation: 6689

You can use Externals Definitions for having subdirectories in your working copy of other repositories.

Upvotes: 6

Related Questions