我已經在這方面做了一些搜索,但沒有一個結果相當不錯。如何在子模塊中嵌套Git子模塊?
$ 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
然後我得到的錯誤:
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.
所以我添加-f參數...
$ git submodule add -f -b 7.x-1.x http://git.drupal.org/project/devel.git drupal/sites/all/modules/contrib/devel
...但是,克隆到合適的位置後,我得到這個錯誤:
fatal: Path 'drupal/sites/all/modules/contrib/devel' is in submodule 'drupal'
Failed to add submodule 'drupal/sites/all/modules/contrib/devel'
我正在一旦我將所有子模塊檢入到位,我就可以在'容器'回購站上做一個「git clone --recursive
」,然後抓取Drupal,我所有的「contrib」模塊(來自Drupal存儲庫)+任何自定義模塊I將添加到drupal/sites/all/modules/custom
。我仍然需要研究是否有可能自動獲取子模塊是一個適當的檢出標籤發佈...
我已經看到關於git-slave(第三方插件)和git-subtree喜歡的事做將所有子模塊爲分支,並將它們融入地方?!)...
我只是覺得我失去了一些東西,因爲這是事SVN可以做真的容易,但everyoen似乎努力使用Git ...
同樣的問題。我已經在docroot/profiles/drupal_profile中使用了git repo,並且在docroot/profiles/drupal_profile/themes和docroot/profiles/drupal_profile/modules dirs中下載了其他repos,並且無法強制git添加此配置文件git repo。 – kenorb