Git submodule Command __git

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.