This article contains instructions for using submodules in your git repository.
Working with Submodules in Git
Adding a Submodule to an existing repo
Navigate to the root folder of the git repo you want to add the submodule to.
Run the following command to add a submodule in a specified folder of the current repo,
git submodule add https://github.com/githubuser/repo-url folder/
git submodule initto initialize the submodule repo within the active repo.
git submodule updateto download the files from the submodule repo.
- You should now see the files populated within the submodule folder.
- Please Note: Now anytime you or another member of your organization clones a new instance of the project, they will need to run
git submodule init&&
git submodule updateto ensure they have the submodule files added to the working project.