Skip to content

Commit 460940f

Browse files
committed
Merge branch 'jl/submodule-status-summary-doc'
* jl/submodule-status-summary-doc: Documentation/submodule: add command references and update options
2 parents 2728139 + 402e8a6 commit 460940f

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

Documentation/git-submodule.txt

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ SYNOPSIS
1515
'git submodule' [--quiet] init [--] [<path>...]
1616
'git submodule' [--quiet] update [--init] [-N|--no-fetch] [--rebase]
1717
[--reference <repository>] [--merge] [--recursive] [--] [<path>...]
18-
'git submodule' [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
18+
'git submodule' [--quiet] summary [--cached|--files] [(-n|--summary-limit) <n>]
19+
[commit] [--] [<path>...]
1920
'git submodule' [--quiet] foreach [--recursive] <command>
2021
'git submodule' [--quiet] sync [--] [<path>...]
2122

@@ -108,8 +109,13 @@ status::
108109
repository and `U` if the submodule has merge conflicts.
109110
This command is the default command for 'git submodule'.
110111
+
111-
If '--recursive' is specified, this command will recurse into nested
112+
If `--recursive` is specified, this command will recurse into nested
112113
submodules, and show their status as well.
114+
+
115+
If you are only interested in changes of the currently initialized
116+
submodules with respect to the commit recorded in the index or the HEAD,
117+
linkgit:git-status[1] and linkgit:git-diff[1] will provide that information
118+
too (and can also report changes to a submodule's work tree).
113119

114120
init::
115121
Initialize the submodules, i.e. register each submodule name
@@ -125,26 +131,29 @@ init::
125131
update::
126132
Update the registered submodules, i.e. clone missing submodules and
127133
checkout the commit specified in the index of the containing repository.
128-
This will make the submodules HEAD be detached unless '--rebase' or
129-
'--merge' is specified or the key `submodule.$name.update` is set to
134+
This will make the submodules HEAD be detached unless `--rebase` or
135+
`--merge` is specified or the key `submodule.$name.update` is set to
130136
`rebase` or `merge`.
131137
+
132138
If the submodule is not yet initialized, and you just want to use the
133139
setting as stored in .gitmodules, you can automatically initialize the
134-
submodule with the --init option.
140+
submodule with the `--init` option.
135141
+
136-
If '--recursive' is specified, this command will recurse into the
142+
If `--recursive` is specified, this command will recurse into the
137143
registered submodules, and update any nested submodules within.
138144

139145
summary::
140146
Show commit summary between the given commit (defaults to HEAD) and
141147
working tree/index. For a submodule in question, a series of commits
142148
in the submodule between the given super project commit and the
143-
index or working tree (switched by --cached) are shown. If the option
144-
--files is given, show the series of commits in the submodule between
149+
index or working tree (switched by `--cached`) are shown. If the option
150+
`--files` is given, show the series of commits in the submodule between
145151
the index of the super project and the working tree of the submodule
146-
(this option doesn't allow to use the --cached option or to provide an
152+
(this option doesn't allow to use the `--cached` option or to provide an
147153
explicit commit).
154+
+
155+
Using the `--submodule=log` option with linkgit:git-diff[1] will provide that
156+
information too.
148157

149158
foreach::
150159
Evaluates an arbitrary shell command in each checked out submodule.
@@ -155,9 +164,9 @@ foreach::
155164
superproject, $sha1 is the commit as recorded in the superproject,
156165
and $toplevel is the absolute path to the top-level of the superproject.
157166
Any submodules defined in the superproject but not checked out are
158-
ignored by this command. Unless given --quiet, foreach prints the name
167+
ignored by this command. Unless given `--quiet`, foreach prints the name
159168
of each submodule before evaluating the command.
160-
If --recursive is given, submodules are traversed recursively (i.e.
169+
If `--recursive` is given, submodules are traversed recursively (i.e.
161170
the given shell command is evaluated in nested submodules as well).
162171
A non-zero return from the command in any submodule causes
163172
the processing to terminate. This can be overridden by adding '|| :'
@@ -237,13 +246,18 @@ OPTIONS
237246
If the key `submodule.$name.update` is set to `rebase`, this option is
238247
implicit.
239248

249+
--init::
250+
This option is only valid for the update command.
251+
Initialize all submodules for which "git submodule init" has not been
252+
called so far before updating.
253+
240254
--reference <repository>::
241255
This option is only valid for add and update commands. These
242256
commands sometimes need to clone a remote repository. In this case,
243257
this option will be passed to the linkgit:git-clone[1] command.
244258
+
245259
*NOTE*: Do *not* use this option unless you have read the note
246-
for linkgit:git-clone[1]'s --reference and --shared options carefully.
260+
for linkgit:git-clone[1]'s `--reference` and `--shared` options carefully.
247261

248262
--recursive::
249263
This option is only valid for foreach, update and status commands.

0 commit comments

Comments
 (0)