![]() ![]() It is simply adds information about a branch in the. Git submodule add -b is not some magically way to keep everything up to date with a branch. Since you have now updated the commit the submodule object is pointing to, you have to commit the changed submodule object into your Git repository. This can be done in two steps by djacobs7 answer. ![]() Instead of populating the content of the submodule to the commit pointed to by the submodule, it replaces that commit with the latest commit on the master branch, THEN it populates the submodule with that commit. The only thing that the -b option buys you is the ability to add a -remote flag to your update as per Vogella's answer: git submodule update -remote The submodule object is still pointing at a specific commit. SubmoduleTestRepo, and you do not need to change the. gitmodules file, but SHA and TAG are not supported! (instead of that, the branch's commit of each module can be tracked and updated using " git add. Note: only branch name is supported in a. So following the same example, it would look like this: ![]() Now, all the -b does is add one line in your. It knows where to find the commit because of the information in the. Whenever you do a git submodule update, it will populate your submodule with content from the commit. Git submodule objects are special kinds of Git objects, and they hold the SHA information for a specific commit. Or do git submodule status from a command line. GitHub shows these as "submodule" objects. You have a submodule object (named SubmoduleTestRepo in this example) in your Git repository. You know you have a Git submodule when you have these two things. ![]() Now all this complexity becomes the much simpler: git clone -single-branch -no-tags in the case of cloning a single tag "branch": git clone -single-branch -branch v2.12.I'd like to add an answer here that is really just a conglomerate of other answers, but I think it may be more complete. Tag, leaving the user in a detached head: git clone -single-branch -branch v2.12.0 & Which of course was also subtly buggy if -branch was pointed at a TagOpt=-no-tags right after cloning & deleting any existing tags: git clone -single-branch & single-branch would have retrieved, or alternatively by setting Which requires hardcoding the " master" name, which may not be the main Manually tweaking the config in a fresh repository: git init git &įetch = +refs/heads/master:refs/remotes/origin/master Without this change the only way of accomplishing this was either by The user might want to avoid all of that overhead to simply use a repository like that to browse the "master" branch, or something like a CI tool might want to keep that one branch up-to-date without caring about any other references. " git log " with the bash completion will slowly show ~40k references instead of 1. creating ~40k tags in linux.git will cause a command like git log -1 >/dev/null to run in over a second instead of in a matter of milliseconds, in addition numerous other things will slow down, e.g. Many git commands pay some fixed overhead as a function of the number of references. This option works without -single-branch as well, and will do a Tags, and which only tracks a single upstream branch. Now -no-tags can be added -single-branch to clone a repository without When supplying -single-branch the primary remote branch will be cloned, but in addition tags will be followed & retrieved. Without this change there's no easy way to clone a repository without (Merged by Junio C Hamano - gitster - in commit a1fdc85, ) clone: add a -no-tags option to clone without tagsĪdd a -no-tags option to clone without fetching any tags. See commit 1524ccd, commit 0dab246, commit 28d67d9 () by Ævar Arnfjörð Bjarmason ( avar). With Git 2.13.x/2.14 (Q2 2017), this will be possible (ie: clone without tags) ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |