I'm working on a content synchronisation module for Drupal. There is a server module, which sits on ona website and exposes content via a web service. There is a also a client module, which sits on a different site and fetches and imports the content at regular intervals.

The server is created on Drupal 6. The client is created on Drupal 7. There is going to be a need for a Drupal 7 version of the server. And then there will be a need for a Drupal 8 version of both the client and the server once it is released next year.

I'm fairly new to git and source control, so I was wondering what is the best way to setup the git repositories? Would it be a case of having a separate repository for each instance, for example:

Drupal 6 server = 1 repository
Drupal 6 client = 1 repository
Drupal 7 server = 1 repository
Drupal 7 client = 1 repository

Or would it make more sense to have one repository for the server and another for the client then create branches for each Drupal version?

Currently I have 2 repositories: one for the client and another for the server.

2 Answers 2


Drupal.org uses just one repository for module, and branches for each module version (for example, 7.x-1.x for module in version 1.x for Drupal 7, 6.x-1.x for module in version 1.x for Drupal 6, 7.x-2.x for module in version 2 for Durpal 7, and so on).

Also, if your server and client share code you may use just one Durpal module with submodules, so all code is in one repository. Users will just enable client or server (and the module that holds the common code).

So, your actual setup is fine if client and server do not share any code or very little and you want to keep them as separate modules. Just add branches for each Drupal version (6.x, 7.x, 8.x). Or join them into one repository and split code into three modules: common, server and client.

You can check the 'Maintaining a drupal.org project with Git' page.

  • Client and server don't share any code so I'll keep them separate. Following Drupal's way of managing repositories seems the best way forward. Thanks! Nov 13, 2012 at 11:57

You can do it like you want really - there isn't really a right or wrong way of doing it.

Personally I would have 2 repos and use branches for different versions. This is also how Drupal does it with modules. They have seperate branches for Drupal 6, 7 and 8 release. Most also have seperate branches for major releases, fx 7.x-1.x and 7.x-2.x being two different branches.

If you have different teams working on the Drupal 6, 7 and 8 versions, you could use separate repos to manage access control. But like I said, there isn't really a right or wrong way of doing this, it really depends on how your team works and how you want/need to administer it.

If you are new to git you might want to read about the git branching model, it's a great blog post about working with git.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.