How do you pull with a submodule?
Pulling with submodules. Once you have set up the submodules you can update the repository with fetch/pull like you would normally do. To pull everything including the submodules, use the –recurse-submodules and the –remote parameter in the git pull command .
Can a submodule point to a branch?
You can set the submodule to track a particular branch (requires git 1.8. 2+), which is what we are doing with Komodo, or you can reference a particular repository commit (the later requires updating the main repository whenever you want to pull in new changes from the module – i.e. updating the commit hash reference).
How do I add a submodule?
In order to add a Git submodule, use the “git submodule add” command and specify the URL of the Git remote repository to be included as a submodule. When adding a Git submodule, your submodule will be staged. As a consequence, you will need to commit your submodule by using the “git commit” command.
How does git submodule work?
A git submodule is a record within a host git repository that points to a specific commit in another external repository. Submodules are very static and only track specific commits. Submodules do not track git refs or branches and are not automatically updated when the host repository is updated.
How can I see my submodule commit?
As the other answers explain, you can use two commands:
- git submodule status , or.
- git ls-tree HEAD , taking only the lines where the second column is commit (if you have awk you can use git ls-tree HEAD | awk ‘$2 == “commit”‘ ).
How do you make a submodule not a submodule?
- git rm –cached the_submodule_path.
- remove the submodule section from the . gitmodules file, or if it’s the only submodule, remove the file.
- do a commit “removed submodule xyz”
- git add the_submodule_path.
- another commit “added codebase of xyz”
How do I open a submodule in GitHub?
How to create submodules in GitHub
- Clone the parent or top-level repository.
- In the root of the parent, issue a “git submodule add” command and provide the GitHub repository’s URL.
- Issue a “git status” command to verify a .
- Add the .
- Push the GitHub submodule add commit back to the server.
How do you fix a dirty submodule?
You can fix it by: either committing or undoing the changes/evolutions within each of your submodules, before going back to the parent repo (where the diff shouldn’t report “dirty” files anymore). To undo all changes to your submodule just cd into the root directory of your submodule and do git checkout .