![]() ![]() Submodule checkouts are normally detached. (There is no requirement for this, and if your Git is older, it won't have absorbgitdirs.) Setup: or, Read this first if the above makes no sense git repositories migrate into the superproject's. You may want to run git submodule absorbgitdirs at the end of all of this, so that all submodule. You don't add with a branch here, you just add-which this uses the checked-out commit like a tag. gitmodules file, and then add the currently checked out commit hash ID of the submodule into the superproject's index. In other words, this will create the entry in the superproject's. If exists and is already a valid Git repository, then it is staged for commit without cloning. What you want to do is to clone the submodule into place first (using any git clone command that you find appropriate), check out the desired commit (by whatever means is appropriate-possibly that same git clone command), and only then use git submodule add: I suppose the issue is that the current index does not yet have the submodule in it. What I think is the answer you need (logically this goes after the next section) gitmodules file to initialize a repo from scratch. Also, the questions I've found relate to using git submodule, not using a. ![]() No answers on Stackoverflow I have found, even suggested duplicates, show if it is possible to specify a tag in. It is perfectly possible to do this though: cd externals/asioĪny ideas on how to specify a specific tag ? Unable to checkout submodule 'externals/asio' Which results in: fatal: Cannot update paths and switch to branch 'asio-1-11-0' at the same time.ĭid you intend to checkout 'origin/asio-1-11-0' which can not be resolved as commit? However, it seems impossible to specify a tag (as opposed to a branch) in the. Git submodule add -force $branch $url $path gitmodules -get "$branch_key")Įcho URL - $url, Path - $path, Branch - $branch gitmodules -get "$url_key")īranch_key=$(echo $path_key | sed 's/\.path/.branch/')īranch=$(git config -f. gitmodules -get-regexp '^submodule\.*\.path$' | ![]() gitmodules to init the submodules in one go: #!/bin/sh Then use the technique shown in Restore git submodules from. gitmodules file to be used as a template for a certain static number of submodules new projects always require. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |