This page provides a quick overview to git submodules. Please refer to more in-depth documentation:
Git submodule is an advanced feature of git that allows embedding a git repository inside another git repository. This is useful in some situations like:
The submodule knows nothing about the parent repository, so you may treat it like a regular git repository. The parent repository basically ignores all changes made inside a submodule path. If updates are made in a submodule, the new commit hash is noticed by the parent repository and available for stating.
Information about a submodule are kept in two places:
This happens for example when you check out a repository without the submodules. To check them out afterwards you can use the following command:
git submodule update --init --remote --recursive
The default behaviour of a submodule when checked out is to be in a detached head state. In this state, commits are hard to retrieve. Make sure to switch to an actual branch before attemping to make (non-local) changes.
Read up on
git rm at https://git-scm.com/docs/git-rm.
Taken from GitHub Gist: