Skip to content

Commit b3cec57

Browse files
Damien Robertgitster
authored andcommitted
doc: document --recurse-submodules for reset and restore
Also unify the formulation about --no-recurse-submodules for checkout and switch, which we reuse for restore. And correct the formulation about submodules' HEAD in read-tree, which we reuse in reset. Signed-off-by: Damien Robert <damien.olivier.robert+git@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent dd0cb7d commit b3cec57

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

Documentation/git-checkout.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ Note that this option uses the no overlay mode by default (see also
296296
submodules according to the commit recorded in the superproject. If
297297
local modifications in a submodule would be overwritten the checkout
298298
will fail unless `-f` is used. If nothing (or `--no-recurse-submodules`)
299-
is used, the work trees of submodules will not be updated.
299+
is used, submodules working trees will not be updated.
300300
Just like linkgit:git-submodule[1], this will detach `HEAD` of the
301301
submodule.
302302

Documentation/git-read-tree.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ OPTIONS
118118
--[no-]recurse-submodules::
119119
Using --recurse-submodules will update the content of all initialized
120120
submodules according to the commit recorded in the superproject by
121-
calling read-tree recursively, also setting the submodules HEAD to be
121+
calling read-tree recursively, also setting the submodules' HEAD to be
122122
detached at that commit.
123123

124124
--no-sparse-checkout::

Documentation/git-reset.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ but carries forward unmerged index entries.
8787
different between `<commit>` and `HEAD`.
8888
If a file that is different between `<commit>` and `HEAD` has local
8989
changes, reset is aborted.
90+
91+
--[no-]recurse-submodules::
92+
When the working tree is updated, using --recurse-submodules will
93+
also recursively reset the working tree of all active submodules
94+
according to the commit recorded in the superproject, also setting
95+
the submodules' HEAD to be detached at that commit.
9096
--
9197

9298
See "Reset, restore and revert" in linkgit:git[1] for the differences

Documentation/git-restore.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ in linkgit:git-checkout[1] for details.
107107
patterns and unconditionally restores any files in
108108
`<pathspec>`.
109109

110+
--recurse-submodules::
111+
--no-recurse-submodules::
112+
If `<pathspec>` names an active submodule and the restore location
113+
includes the working tree, the submodule will only be updated if
114+
this option is given, in which case its working tree will be
115+
restored to the commit recorded in the superproject, and any local
116+
modifications overwritten. If nothing (or
117+
`--no-recurse-submodules`) is used, submodules working trees will
118+
not be updated. Just like linkgit:git-checkout[1], this will detach
119+
`HEAD` of the submodule.
120+
110121
--overlay::
111122
--no-overlay::
112123
In overlay mode, the command never removes files when

Documentation/git-switch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ name, the guessing is aborted. You can explicitly give a name with
183183
Using `--recurse-submodules` will update the content of all
184184
initialized submodules according to the commit recorded in the
185185
superproject. If nothing (or `--no-recurse-submodules`) is
186-
used, the work trees of submodules will not be updated. Just
186+
used, submodules working trees will not be updated. Just
187187
like linkgit:git-submodule[1], this will detach `HEAD` of the
188188
submodules.
189189

0 commit comments

Comments
 (0)