Download git submodules7/6/2023 ![]() # note, bellow pulls the submodules if you didn't specify them when cloning parent project, ref: Likely because it looks at the origin (pointer to remote) in github for the available branches. gitmodules file, for that you need remote. # note, command bellow will not pull the right branch - even if it's in your. # - git submodule update -init initializes your local configuration file and clones the submodules for you, using the commit specified in the main repository. I recommend: # - git submodule init initializes your local configuration file to track the submodules your repository uses, it just sets up the configuration so that you can use the git submodule update command to clone and update the submodules. Equivalent to passing -remote to git submodule update. It actually passes -no-fetch to git submodule update as well on the grounds they the submodule has only just been cloned, so fetching from the remote again only serves to slow things down.Īll submodules which are cloned will use the status of the submodule’s remote-tracking branch to update the submodule, rather than the superproject’s recorded SHA-1. Remote-tracking branch rather than with the SHA-1 recorded in the superproject. ![]() Pass a -remote switch to the implicit git submodule update command forĪny use case where you want the submodules to be checked out on their When using git clone -recurse-submodules there was previously no way to (Merged by Junio C Hamano - gitster - in commit 9476094, ) clone: add -remote-submodules flag See commit 4c69101 () by Ben Avison ( bavison). You can initiate fetching the submodule using multiple threads, in parallel.įor instances: git fetch -recurse-submodules -j2Įven better, with Git 2.23 (Q3 2019), you can clone and checkout the submodule to their tracking branch in one command! Update 2016, with git 2.8: see " How to speed up / parallelize downloads of git submodules using git clone -recursive?" With version 1.6.5 of git and later, you can do this automatically by cloning the super-project with the –-recursive option: git clone -recursive git:///mysociety/whatdotheyknow.git See Working with git submodules recursively for the init part. If -recursive is specified, this command will recurse into the registered submodules, and update any nested submodules within. This change reduces the time for git fetch ( man) in my repo from 25s to 6s.Īs joschi mentions in the comments, git submodule now supports the -recursive option (Git1.6.5 and more). Similar logic can be found in cat-file, pack-objects and more. Notify setup_revisions() that the input is not filenames by passing assume_dashdash, so it can avoid redundant stat for each ref.Īlso suppress refname_ambiguity flag to avoid filesystem lookups for each object. ![]() The argv argument of collect_changed_submodules() contains only object ids (the objects references of all the refs). (Merged by Junio C Hamano - gitster - in commit 2ce9d4e, ) submodule: suppress checking for file name and ref ambiguity for object ids ![]() See commit a462bee () by Orgad Shaneh ( orgads). Note that Git 2.29 (Q4 2020) brings a significant optimization around submodule handling. If you just want to clone them at their recorded SHA1: git clone -recurse-submodules Git 2.23 (Q3 2019): if you want to clone and update the submodules to their latest revision: git clone -recurse-submodules -remote-submodules ![]()
0 Comments
Leave a Reply. |