Submodule is the information about the other modules you refer to in your git.
Over ....
What, that's over.
Yes, the wood is wrong. It's that simple.
In essence and you manually copy a reposit came to your project directory, and then take a small notebook to write down where this reposit stolen from, wood what difference.
Just, we use many find this inconvenient, so, to git a submodule command. to facilitate operation.
Although there are a lot of nonsense, but the essence is that. The following points illustrate that the main code base and the child code base are independent of each other
Your project has nothing to do with your submodule. You just use someone else's code, and to make it easier to manage Git's integrated submodule command, this command can be replaced in other ways, such as scripts.
Submodule on a git project, how to update synchronization on how to update synchronization, do not always think from your project to manage other people's submodule, thinking about the problem is wrong.
(Do I need to knock commands from the Linux kernel project with the new Apache project?) , need it ... , I could use 2 of them.
Although
1. The Submodule warehouse is also under the Git/modules folder of your project.
2. Provide submodule this handy command main code base refers to the child code base submission (commit) instead of the branch (branch)
When your project is built, you must simply refer to a version of Submodule (corresponding to a commit) rather than a branch. So the default is detached from XXXXX (commit ID);
Because, it is likely that people who provide submodule, the documents submitted in a few days will cause your current project is completely unavailable .... manually maintaining a child code base
The above default is the most common way, but also may be your submodule is the maintenance of their own, controllable.
Then these commands can be completely handled (remember that the wood is related, not big enough to knock a few lines of ordinary orders, I have the most headache to remember command)
(Note: Stolen from the overflow)
# Add submodule to track Master branch
git submodule add-b master [URL to Git repo];
# update your submodule
git submodule update--remote
Reference:
Use of Git submodule
Git submodule using the full tutorial