Skip to content

How to add new submodules?

Guoqing Ge edited this page Aug 12, 2024 · 1 revision

NOTE: Although adding a new submodule is not a difficult task, it does need full attention since cleaning up wrongly added submodules is non-trivial.
Use UPP/MPASSIT as examples:

1. Clone the rrfs-workflow

git clone --recursive git@github.com:rrfsx/rrfs-workflow
cd rrfs-workflow

2. Add the sorc/upp and sorc/ submodules:

git submodule add https://github.com/NOAA-EMC/UPP sorc/UPP
git submodule add https://github.com/LarissaReames-NOAA/MPASSIT sorc/MPASSIT

3. Add the branch and ignore keys

vi .gitmodules

Make modifications as follows:

[submodule "sorc/UPP"]
        path = sorc/UPP
        url = https://github.com/NOAA-EMC/UPP
        branch = develop
        ignore = all
[submodule "sorc/MPASSIT"]
        path = sorc/MPASSIT
        url = https://github.com/LarissaReames-NOAA/MPASSIT
        branch = master
        ignore = all