Friday, September 9, 2022

Git: Get Submodules from an already Cloned Repo

A git repo that contains a submodule or modules is cloned using the --recurse-submodules command-line option such as the following:

git clone --recurse-submodules -j8 git://github.com/foo/bar.git

At one time or another, every developer has performed a git clone and forgotten the --recurse-submodules command-line option. The following git command will remedy this problem but updating the submodules for a git repo ever in the case where the git clone was performed without specifying --recurse-submodules:

git submodule update --init --recursive


No comments :

Post a Comment