GitHub Submodule Management

Category
Drupal Version
Tags

Submodules allow you to keep a Git repository as a subdirectory of another Git repository. This lets you clone another repository into your project and keep your commits separate.

To define the submodules for the various GT Theme components, add the following sections to the .gitmodules file for each repository:

[submodule "gt_tools"]
path = web/modules/contrib/gt_tools
url = https://github.gatech.edu/ICWebTeam/gt_tools-8.x.git
update = checkout
branch = master
ignore = dirty
shallow = TRUE

[submodule "gt_theme"]
path = web/themes/contrib/gt_theme
url = https://github.gatech.edu/ICWebTeam/gt_theme-8.x.git
update = checkout
branch = master
ignore = dirty
shallow = TRUE

[submodule "hg_reader"]
path = web/modules/contrib/hg_reader
url = https://github.gatech.edu/ICWebTeam/hg_reader-8.x.git
update = checkout
branch = master
ignore = dirty
shallow = TRUE

[submodule "gt_profile_curie"]
path = web/profiles/contrib/gt_profile_curie
url = https://github.gatech.edu/ICWebTeam/gt_profile_curie.git
update = checkout
branch = master
ignore = dirty
shallow = TRUE

 

To initialize your local configuration file and fetch all the data from each project and check out the appropriate commit, run the following command:

git submodule update --init --recursive


To initialize your local configuration file and fetch all the data from each project and check out the appropriate commit, run the following command:

git submodule update --recursive


For more information about submodules, see the Git product documentation on moduleshttps://www.git-scm.com/docs/gitmodules

Documentation courtesy of Veronique Topping