9/23/2023 0 Comments Git submodule specific branch![]() It is a little annoying to make changes to the submodule due to the requirement to check out onto the correct submodule branch, make the change, commit, and then go into the superproject and commit the commit (or at least record the new location of the submodule). Gitslave (that you already looked at) seems to be the best fit, including for the commit operation. add and commit in order to record the new commit of the submodule.git fetch/pull to make sure it has the latest commits on the right branch. ![]() So for a parent to track automatically the latest commit of a given branch of a submodule, it would need to: git fetch origin or git fetch, remote..fetch values are used as the refspecs they specify which refs to fetch and which local refs to update.Since it is a Git repo on its own, the "history of all commits" is accessible through a git log within that submodule. This configuration is used in two ways: When git fetch is run without specifying what branches and/or tags to fetch on the command line, e.g. ![]() Will get updates from the same branch that you used to initialize the submodule, which is usually what you want.Ī submodule is a single commit referenced by a parent repo. This means that future calls to $ git submodule update -remote. This allows you to easily record a submodule.branch option in. It seems like pulls everything then switches to branch. Summary After upgrading our gitlab runners from 13.10.0 to 13.11.0 we can't checkout a branch in a submodule anymore. On our buildserver I would like to pull as minimum as possible. is used to indicate that the name of the branch in the submodule should be the same name as the current branch in the current repository. The submodule is tracked by a branch name and not by a sha commit number. If you had a submodule already present you now wish would track a branch, see " how to make an existing submodule track a branch".Īlso see Vogella's tutorial on submodules for general information on submodules. After adding a submodule with a specific branch, a new cloned repository (after git submodule update -init) will be at a specific commit, not the branch itself ( git status on the submodule shows 'Not currently on any branch'). " git submodule" started learning a new mode to integrate with the tip of the remote branch (as opposed to integrating with the commit recorded in the superproject's gitlink). Git 1.8.2 added the possibility to track branches. This answer below still reflect the old naming convention. Edit (2020.12.28): GitHub change default master branch to main branch since October 2020.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |