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>
Damien Robert committed
Apr 6, 2020 at 15:57 UTC
b3cec57338db7b01681716d072f36c29b7f770f4
5 files changed
+20
-3
Documentation/git-checkout.txt
+1
-1
@@ -296,7 +296,7 @@ Note that this option uses the no overlay mode by default (see also
296
submodules according to the commit recorded in the superproject. If
297
local modifications in a submodule would be overwritten the checkout
298
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.
300
Just like linkgit:git-submodule[1], this will detach `HEAD` of the
301
submodule.
302
Documentation/git-read-tree.txt
+1
-1
@@ -118,7 +118,7 @@ OPTIONS
118
--[no-]recurse-submodules::
119
Using --recurse-submodules will update the content of all initialized
120
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
122
detached at that commit.
123
124
--no-sparse-checkout::
Documentation/git-reset.txt
+6
@@ -87,6 +87,12 @@ but carries forward unmerged index entries.
87
different between `<commit>` and `HEAD`.
88
If a file that is different between `<commit>` and `HEAD` has local
89
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.
96
--
97
98
See "Reset, restore and revert" in linkgit:git[1] for the differences
Documentation/git-restore.txt
+11
@@ -107,6 +107,17 @@ in linkgit:git-checkout[1] for details.
107
patterns and unconditionally restores any files in
108
`<pathspec>`.
109
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
+
121
--overlay::
122
--no-overlay::
123
In overlay mode, the command never removes files when
Documentation/git-switch.txt
+1
-1
@@ -183,7 +183,7 @@ name, the guessing is aborted. You can explicitly give a name with
183
Using `--recurse-submodules` will update the content of all
184
initialized submodules according to the commit recorded in the
185
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
187
like linkgit:git-submodule[1], this will detach `HEAD` of the
188
submodules.
189