Adding a Submodule to a Git Repository
Adding a submodule to your git repository is actually quite simple. For example, if you are in the working directory of the repository, to add a new submodule:
$ git submodule add <git url>
git submodule add– This simply tells Git that we are adding a submodule. This syntax will always remain the same.
<git url>– This is the external repository that is to be added as a submodule.
If you want to more control over
$ git submodule add -b <branch> <git url> <folder/subfolder>
<branch>– This fetching different branch from your
<folder/subfolder>– This add your submodule to another subfolder
activate the submodule:
$ git submodule init
If you are enjoying my content, maybe you would enjoy buying me a coffee as well.
Just a food for thought.