Skip to main content

n Drupal and all other frameworks it is likely to use sub modules. I spent several hours to use submodules in git. I was unable to find an easier way to pull all sub modules. There are dozens of articles on google and stackoverflow, but non works as expected.

In this article I will explain the process and a simple script to use with git sub modules and save you a lot of time.

  1. Copy .gitmodules from root to directory `web/modules/custom`
  2. Run inside custom/ 
    cat .gitmodules | grep url | cut -d'=' -f2 | xargs -n1 git submodule add