I'm looking for a way to use git to pull both core and modules. Let's say for example that I clone Drupal core from the Drupal git, and commit to my own git repo; then, I pull a bunch of modules, and also commit to my own git repo.

Is this even possible? Can I have sub folders within a repository that are checked out from a different repository? Can I still use Drupal to keep my code up to date? Perhaps I'm not really understand some git fundamentals.

  • The question is not specific for Drupal, as it applies to every case files are pulled from different repositories.
    – apaderno
    Aug 29, 2011 at 4:59
  • This is not really the best way to do it, you can better use a combination of make files, Features and install profiles. This approach has the advantage that only your own modules/themes are kept in your repo, all others are coming from drupal.org.
    – Attiks
    Aug 29, 2011 at 7:51

1 Answer 1


You can done it easily with Git with the submodules. Every subfolder from yours sites/all/modules (for example) can be a submodule that clone the repo from drupal.org.

  • This seems pretty ideal, I really was not aware of sub modules. I'm using phpstorm as my IDE, which I love, unfortunately it does not support submodules yet ...
    – user379468
    Aug 29, 2011 at 14:12
  • How do you deal with custom code, where do you check them out without having to create a separate submodule/git repo for each one? Aug 14, 2012 at 22:11

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.