git clone containing sub-module project

When a program contains git submodules (submodule), cloned directly down submodule directory is empty.

There are two ways to solve:

method one

If the project has been cloned into a local, perform the following steps:

  1. Initialize the local sub-module configuration file
    git submodule init
  2. Update project, crawl sub-module content.

    git submodule update

    Method Two

    A simpler way is performed git cloneplus the time --recursiveparameter. It will automatically initialize and update each sub-module. E.g:

git clone --recursive https://github.com/example/example.git

other

About git submodules more, see the official documentation .


More technical articles, please visit my personal website: https://www.codingbit.net

Guess you like

Origin www.cnblogs.com/codingbit/p/git-clone-with-submodule.html