There is one situation we often encounter: one working project needs to include and use another. Git addresses this problem through submodule which allows you to use another Git repository as a subdirectory. Some operations related to the GIT submodule are shown below.
# way 1: recursively clone the entire project(include it's subrepository)
git clone --recursive <remote_repo_url>
# way 2: initialize the submodule and update it after normal clone
git submodule update --init --recursive
--> Describe the problem
There is one situation we often encounter: one working project needs to include and use another. Git addresses this problem through submodule which allows you to use another Git repository as a subdirectory. Some operations related to the GIT submodule are shown below.
--> Demonstrate the solution
Add a new submodule in the local git repository:
Load the submodule in two ways:
Delete the submodule in the local git repository: