Skip to content

Instantly share code, notes, and snippets.

@mortenson
Created May 9, 2015 17:04
Show Gist options
  • Save mortenson/10dbe3c4c55b41a238bd to your computer and use it in GitHub Desktop.
Save mortenson/10dbe3c4c55b41a238bd to your computer and use it in GitHub Desktop.
Drupal subtree example
$ cd drupal-multisite-subtree
$ ### This is a basic Drupal 7 install
$ ls
CHANGELOG.txt INSTALL.txt authorize.php misc sites
COPYRIGHT.txt LICENSE.txt cron.php modules themes
INSTALL.mysql.txt MAINTAINERS.txt includes profiles update.php
INSTALL.pgsql.txt README.txt index.php robots.txt web.config
INSTALL.sqlite.txt UPGRADE.txt install.php scripts xmlrpc.php
$ ### Lets add a new multisite
$ git subtree add --prefix sites/site1 git@github.com:mortenson/site1.git master
...
Added dir 'sites/site1'
$ ### And another
$ git subtree add --prefix sites/site2 git@github.com:mortenson/site2.git master
...
Added dir 'sites/site2'
$ ### Let's see what our git log looks like now
$ git log --pretty=oneline
ca3355b145a46c4757f56e052d61a59079dd0ae3 Add 'sites/site2/' from commit 'e9aaa7656158d1f61a2cc8f0cbdc776f7f36e3d0'
bae0ce3923b7191df665a4874137851027725e2d Add 'sites/site1/' from commit '65729b920447c883b91ee6230c2754c2eac9bf08'
e9aaa7656158d1f61a2cc8f0cbdc776f7f36e3d0 Added default settings.php
65729b920447c883b91ee6230c2754c2eac9bf08 Added default settings.php
83578bb346968c7164d5a8128239c77444bfe1d5 Initial commit of Drupal 7.x
$ ### Push it baby!
$ git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment