| 59 | |
| 60 | == Drupal modules == |
| 61 | |
| 62 | Normally, Drupal modules are installed under sites/default/modules. This would be fine with our approach but it would create unnecessary huge merges when updating the core and it keeping all parts separately accessible from the root directory of our installation is much clearer arranged. So we create a modules (and perhaps also a files, libraries and themes) directory and a symbolic link to it: |
| 63 | {{{ |
| 64 | mkdir modules |
| 65 | cd core/sites/default |
| 66 | ln -s ../../../modules |
| 67 | cd ../../../ |
| 68 | }}} |
| 69 | |
| 70 | Now we install a module in it. As an example we chose the [http://drupal.org/project/i18n i18n] module. At the Drupal project page we click on the green "Version Control" tab and chose "Version to work from: 6.x-1.x". There we get the URL we need to add the project as a remote. |
| 71 | {{{ |
| 72 | git remote add i18n-6.x-1.x http://git.drupal.org/project/i18n.git 6.x-1.x |
| 73 | git fetch |
| 74 | }}} |
| 75 | |
| 76 | Now we do not install the latest version 6.x-1.10 but version 6.x-1.9. The reason is that we have patched that version and we want to use git-subtree and [http://git-scm.com/book/en/Git-Branching-Rebasing git-rebase] to reapply our patches to the newest version. First, we install 6.x-1.9: |
| 77 | {{{ |
| 78 | git subtree add --squash --prefix="modules/i18n" 6.x-1.9 |
| 79 | }}} |
| 80 | |
| 81 | Then we overwrite the newly imported files with our patched version and commit the patches. At this point, [http://git-scm.com/book/ch6-2.html interactive staging] might be a good idea. |
| 82 | {{{ |
| 83 | cp ~/i18n.module modules/i18n |
| 84 | cp ~/i18nsync.module modules/i18n |
| 85 | git add modules/i18n/i18n.pages.inc |
| 86 | git commit -m "i18n: Exchange title with nid in translation box." |
| 87 | git add modules/i18n/i18nsync/i18nsync.module |
| 88 | git commit -m "i18n: Inherit path when syncing." |
| 89 | }}} |
| 90 | |
| 91 | As our core directory is not empty, we can add the symbolic link to our modules directory: |
| 92 | {{{ |
| 93 | git add core/sites/default/modules |
| 94 | git commit -m "Add symbolic link to modules directory." |
| 95 | }}} |
| 96 | |
| 97 | == Update a patched module == |
| 98 | |