I want to know that is there any way to add git sub module to branch of master repository. So when i pull the branch code, the sub module should also be checked out?If possible please comment the steps
Asked
Active
Viewed 831 times
1 Answers
0
Yep, it's possible
but:
Submodule
is a standalone git project so the code will be checked out to a new folder under the root folder and it's not part of your master branch.
Your root folder will contain a submodule file and you will have to "int && update" it on every clone you make.
# Add the desired submodule ot your code base
git submodule add <url>
You must run two commands:
git submodule init
to initialize your local configuration file, and
git submodule update
to fetch all the data from that project and check out the appropriate commit listed in your superproject:
So the full script is this:
git submodule add <url>
git submodule init
git submodule update

Community
- 1
- 1

CodeWizard
- 128,036
- 21
- 144
- 167