

Optionally take a pathspec",, Git v2.13.While Git is a powerful and popular Distributed Version Control System, Git’s Submodule feature and Archive feature make Git even more powerful. Since bb62e0a (" clone: teach -recurse-submodules to recurse-submodules option as alias for -recursive", recurses-submodules alias was added in ccdd3da (" clone: Add the Initially "clone" just understood -recursive until the " -recurse-submodules" to mean the same thing. "ĭoesn't error out because " clone" understands both " -recursive" and (Merged by Junio C Hamano - gitster - in commit 2cfab60, ) parse-options: don't emit "ambiguous option" for aliasesĬhange the option parsing machinery so that e.g. See commit 5c38742 () by Nguyễn Thái Ngọc Duy ( pclouds).
DOWNLOAD GIT SUBMODULES UPDATE
That would clone and update every submodules, except sub0 and sub2.īonus, with Git 2.22 (Q2 2019) " git clone -recurs" works better. no-checkout/ -n, -bare, or -mirror is given)Įxample from the t/t7400-submodule-basic.sh test: git clone -recurse-submodules="." \ Repository does not have a worktree/checkout (i.e. This is equivalent to running git submodule update -init -recursive immediately after the clone is finished.

" (meaning all submodules) if no pathspec is provided. The resulting clone has submodule.active set to the provided pathspec, or ". Submodules are initialized and cloned using their default settings. If no pathspec is provided, all submodules are initialized and cloned. So the git clone -recursive man page now reads: -recurse-submodules:Īfter the clone is created, initialize and clone submodules within based on the provided pathspec. Recursing into submodules, so advertise this spelling here as the In a lot of other commands we already have ' -recurse-submodules' to mean

A simple ' -recurse' doesn't convey what is being Well as marked hidden in the options array, to streamline the optionsįor submodules. The given pathspec, such that any future invocation of git submoduleĪdditionally the switch ' -recurse' is removed from the Documentation as This also configures the ' submodule.active' configuration option to be In order to construct more complex pathspecs, -recurse-submodules can be given multiple times. If no pathspec is provided, -recurse-submodules will recursively initialize and clone all submodules by using a default pathspec of ". Which describes which submodules should be recursively initialized and Teach clone -recurse-submodules to optionally take a pathspec argument The second line (to be executed only once) is needed because the clone -recurse-submodules[= immediately after the clone is finished.Īnd that would only checkout the submodule at its gitlink recorded SHA1, not at the latest remote origin/master SHA1.īy adding the submodule.update config setting, you ensure that the selective clone of the submodule will be followed by an update, only for that submodule.Īs part of the Git 2.13 (Q2 2017) "active submodule" feature (see " Ignore new commits for git submodule"), you have this commit bb62e0a from Brandon Williams ( bmwill): clone: teach -recurse-submodules to optionally take a pathspec With Git 2.13 (and the help of submodule.update config setting): git clone -recurse-submodules="bundle/syntastic"

How do I update a specific submodule, located in say bundle/syntastic, without updating any other submodules?
