问题描述:

This question already has an answer here:

  • Checkout subdirectories in Git?

    6 answers

网友答案:

You should use submodules for this purpose.

Submodules allow foreign repositories to be embedded within a dedicated subdirectory of the source tree, always pointed at a particular commit.


git submodule

Break your big project to sub projects as you did so far.
Now add each sub project to you main project using :

git submodule add <url>

Once the projected is added tot your repo you have to init and update it.

git submodule init
git submodule update
相关阅读:
Top