An example of how to easily add Git submodules - Coffee Talk: Java, News, Stories and Opinions

PHOTO EMBED

Thu Jun 10 2021 18:33:03 GMT+0000 (Coordinated Universal Time)

Saved by @KCM

submodule@example:~$ mkdir surface
submodule@example:~$ cd surface
submodule@example:~$ git init
submodule@example:~$ touch destroyer.html
submodule@example:~$ git add .
submodule@example:~$ git commit -m "Add surfae fleet"
submodule@example:~$ mkdir submarines
submodule@example:~$ cd submarines
submodule@example:~$ git init
submodule@example:~$ touch nuclear.html
submodule@example:~$ git add .
submodule@example:~$ git commit -m "Add submarine to fleet"
submodule@example:~$ cd ..
submodule@example:~$ git submodule add ./submarines
submodule@example:~$ git init
submodule@example:~$ git add .
submodule@example:~$ git commit -m "Add the submodule submarines"
content_copyCOPY

https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/The-git-submodule-add-example