When you have a dependency to a external library which in most cases is because you had to fork the repository to make a change for yourself that the community/author will not/can not accept

Add a file in the root of the repository called .gitmodules

[submodule "module_name"]
	path = path_within_repo
	url = relative_or_full_path_to_other_repository