How to download the projects within a distribution using git, not just the distribution itself?

I've set \$options['package-handler'] = 'git_drupalorg'; set in my .drushrc.php file. Now when I run drush make for a distribution (in this case, the 7.x-3.x-dev release of Commons), the distribution itself gets checked out using git, but not the individual projects (modules and themes) within it. How do I also get those projects checked out as individual git repositories? I'm assuming submodules come into play, but what exactly do I need to do to get that working?

• This is definitely a fair question, but it's also worth asking yourself if you're sure you want to do this. Submodules will add a lot of complexity to your setup, much of which can be avoided if you use a tool like drush make (built in to drush as of drush 5) to manage contrib modules and patches instead. – Patrick Kenny Jan 31 '13 at 6:15
• I've been working on some patches to the modules within Commons, so having the individual projects checked out via git would speed up that process. I'm not necessarily planning on deploying that way. – Matt V. Jan 31 '13 at 6:19

There's no direct way to perform this.

This is a sequence that may fit for a dev environment. It is based on --package-handler=wget and drush make. No submodules. Contrib is downloaded to sites/all.

cd /tmp
drush dl commons --variant=profile-only
drush make commons/drupal-org-core.make distro
mv commons distro/profiles
rm -rf distro/sites/all/
drush make --no-core --no-gitinfofile --working-copy distro/profiles/commons/drupal-org.make  distro/sites/all


I used sites/all because drush make wants a non-existent destination, so distro/profiles/commons is not an option. An alternative is to perform the last make in a tmp directory and copy over the profile directory afterwards.

As a side note, drupal.org profiles provide three packages to download: profile-only, core-profile-and-projects, profile-and-projects. See http://drupal.org/node/1867206 for reference.

drush dl provides an option to choose among these three tarballs: --variant=<full,projects,profile-only>. All three options are available for --package-handler=wget whereas for git_drupalorg the only valid option is profile-only, since it corresponds to a single git project.

That said, there's room to implement a more complex workflow to provide (drush dl commons --variant=full --package-handler=git_drupalorg) by using submodules.