Ad

Git Submodule Update Init

- 1 answer

Whenever I clone a git repository with submodules in it, I always run git submodule update --init and I can see that the repository is checking out each submodule in a specific commit.

How does it know where to point it at and wher ecan I modified that value?

Thanks

Ad

Answer

You can see what commit the submodules are pegged to by doing:

git submodule status

Which will give you the list of submodules, where they are, and what sha they are pegged to.

If you want to change this, then you need to go into the submodule checkout the code to the version you want and then commit the change back into the main repository.

Ad
source: stackoverflow.com
Ad