12/10/2023 0 Comments Git submodule specific branch![]() ![]() Git repository, then this is added to the changeset without cloning. If path does exist and is already a valid If path does not exist, then the submodule is created byĬloning from the named URL. ![]() Path is the relative location for the cloned submodule to exist in the Theres no way to tell which commits are the newest ones, unless you have a branch name like release/1.0 that holds the newest hash ID for the release/1. This is because the hash IDs look totally random. However, it will work correctly only if git submodule add forwards the -b option to git clone.Ī guaranteed way of achieving the desired result (without making any assumptions about inner workings of git submodule add) is to git clone the submodule repository on your own using the options of your choice and then add the existing directory as a submodule: git clone -b myBranch -single-branch -depth=1 large_repo 1 Except, that is, during the original git clone of this submodule: Git needs to find commits, and to find commits, Git needs some names. ![]() Doing git submodule update -remote seems to force git to focus on the branch you specify in the. git submodule update seems to always fetch the latest commit regardless of the branch. You also have to tell Git to only look at the specified branch for the latest commit. Thus, if git submodule add performs the cloning with git clone, then in your use case -single-branch is implied. Along with stefans answer to this question. If the HEAD at the remote did not point at anyīranch when -single-branch clone was made, no remote-tracking This means that they arent on a current branch. Remote-tracking branch for the branch this option was used for the The submodule repositories added by git submodule update are headless. depth option, this is the default, unless -no-single-branchįurther fetches into the resulting repository will only update the Summary After upgrading our gitlab runners from 13.10.0 to 13.11.0 we can't checkout a branch in a submodule anymore. git submodule add -branch v1.3.37 :foo.git vendor/foo. To keep this simple Id like to avoid going into subdirectories and running git commands there. Is given to fetch the histories near the tips of all branches.Ĭlone only the history leading to the tip of a single branch,Įither specified by the -branch option or the primary branch For a rails template Id like to add a submodule of a specific tag to new rails apps. Implies -single-branch unless -no-single-branch Create a shallow clone with a history truncated to the specified ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |