So, my colleague wanted to have files in three layers of directories. So, what happens when you want to nest this stuff? Nesting Submodule Recursion Once you’ve checked out this submodule, you can do any normal operations in this submodule, like pulls, pushes, commits, tags, etc. I’ve used this, mostly with Ansible playbooks, where I’ve consumed someone else’s role, like this: My_Project In other words, you can track two separate but linked parts of your code in the same tree, working on each in turn, and without impacting each other code base. If you change a file in that submodule, it marks the path of the submodule as “dirty” (because you have an uncommitted change), and if you either commit that change, or pull an updated commit from the source repository, then it will mark the path of the submodule as having changed. git/modules/$SUBMODULE_NAME/HEAD which contains the commit reference). Git stores the commit reference of the submodule (via a file in. When you clone a repository with a submodule attached, it creates the directory the submodule will be cloned into, but leave it empty, unless you either do git submodule update -init -recursive or, when you clone the repository initially, you can ask it to pull any recursive submodules, like this git clone -recursive. gitmodules, and, when checked out, the HEAD file in the. Git SubmodulesĪ submodule is a separate git repository, attached to the git repository you’re working on via two “touch points” – a file in the root directory called. First, let’s quickly drill into what a Submodule is. One of my colleagues asked today about using recursive git submodules.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |