I've done a fair bit of searching on this but none of the results quite hit the nail on the head.
$ mkdir blah
$ git init
$ git submodule add -b 7.x http://git.drupal.org/project/drupal.git drupal
$ git submodule add -b 7.x-1.x http://git.drupal.org/project/devel.git drupal/sites/all/modules/contrib/devel
I then get the error:
The following path is ignored by one of your .gitignore files:
drupal/sites/all/modules/contrib/devel
Use -f if you really want to add it.
So I add the -f parameter...
$ git submodule add -f -b 7.x-1.x http://git.drupal.org/project/devel.git drupal/sites/all/modules/contrib/devel
... but, after cloning into the right place, I get this error:
fatal: Path 'drupal/sites/all/modules/contrib/devel' is in submodule 'drupal'
Failed to add submodule 'drupal/sites/all/modules/contrib/devel'
I'm working on the principal that once I have all the submodules checked into place, I could just do a "git clone --recursive
" on the 'container' repo, which would then grab Drupal, all my "contrib" modules (from the Drupal repository) + any custom modules I would add into drupal/sites/all/modules/custom
. I still need to research if it's possible to automatically get the submodule to be an appropriate checked out tagged release...
I've seen posts about git-slave (a 3rd party addon) and git-subtree (which looked like something to do with adding all your submodules into branches and merging them into place?!)...
I just feel like I'm missing something as this is something SVN could do REALLY easily and yet everyoen seems to struggle with using Git...