Skip to content

How to Clone a Git Repository with Submodules

Summary

This will be a quick article to list the steps to take in order to clone a submodule with git.

Steps Needed

  • Navigate to the proper directory by using cd ~/Downloads/GitHub/<repo>.
  • Once in the proper directory, do the following:
submodule@example:~$ git clone https://github.com/user/repo.git
submodule@example:~$ git submodule init
submodule@example:~$ git submodule update

Once this has been completed, the repo can be used as a submodule.

References

https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-clone-a-git-repository-with-submodules-init-and-update