![]() ![]() gitmodules | grep -Po "(?<=path = )keyword. What I come up with is the following code, but I would like to know if there is a git command to do the trick #!/bin/bash Of course I can manually cd into every submodule and git checkout feature_B but assume I have lots of submodules, or heck, even only 5, I'd love a programmatic way for doing it. Is it not possible to lock the branch of a submodule to the parent repository branch EDIT: Based on: How can I specify a branch/tag when adding a Git submodule Looks like I can specify a branch for the sub module repository in. Now I want to go back to feature_B for every submodule that has such branch. ![]() I have already tried: switch to feature branch. Now i want my feature branch to depend on another repo as a submodule but i want that submodule to be visible only to that feature branch not to the main branch. ![]() There is a special git submodule command included with git, and this command takes various arguments in order to add/update/delete your submodules. More information can be found on git-submodule (1). Which you may also add manually, if you'd rather do so. separate git repository in its own right. 1 Answer Sorted by: 7 Since git 2.22, you can use git submodule set-branch for that: git submodule set-branch -branch mybranch public This adds a branch mybranch to your. The last command however has reset every submodule to the commit specified by the topmodule. Say i have a repo that has two branches: main and feature. A submodule in a git repository is like a sub-directory which is really a. If there’s a new submodule, we’ll have to. You’ll have to update the submodules: git submodule update. Submodules that reference branches are not recommended, because they. When pulling a project’s latest changes, submodules do not get updated automatically. Git submodule update -init -recursive -force Submodules can also reference a specific branch, but that is not the default behavior. Assume the following git structure with submodules: rootĪssume that I am working on a branch feature_B from the top module and I am manually creating a branch called feature_B in every submodule.Īt some point (assume all the changes in every submodule are pushed to the remote) I need to run some tests with the master topmodule, so what I do: cd $TOPMODULE ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |