@@ -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
@@ -106,8 +107,13 @@ status::
106107 repository and `U` if the submodule has merge conflicts.
107108 This command is the default command for 'git submodule'.
108109+
109- If ' --recursive' is specified, this command will recurse into nested
110+ If ` --recursive` is specified, this command will recurse into nested
110111submodules, and show their status as well.
112+ +
113+ If you are only interested in changes of the currently initialized
114+ submodules with respect to the commit recorded in the index or the HEAD,
115+ linkgit:git-status[1] and linkgit:git-diff[1] will provide that information
116+ too (and can also report changes to a submodule's work tree).
111117
112118init::
113119 Initialize the submodules, i.e. register each submodule name
@@ -123,26 +129,29 @@ init::
123129update::
124130 Update the registered submodules, i.e. clone missing submodules and
125131 checkout the commit specified in the index of the containing repository.
126- This will make the submodules HEAD be detached unless ' --rebase' or
127- ' --merge' is specified or the key `submodule.$name.update` is set to
132+ This will make the submodules HEAD be detached unless ` --rebase` or
133+ ` --merge` is specified or the key `submodule.$name.update` is set to
128134 `rebase` or `merge`.
129135+
130136If the submodule is not yet initialized, and you just want to use the
131137setting as stored in .gitmodules, you can automatically initialize the
132- submodule with the --init option.
138+ submodule with the ` --init` option.
133139+
134- If ' --recursive' is specified, this command will recurse into the
140+ If ` --recursive` is specified, this command will recurse into the
135141registered submodules, and update any nested submodules within.
136142
137143summary::
138144 Show commit summary between the given commit (defaults to HEAD) and
139145 working tree/index. For a submodule in question, a series of commits
140146 in the submodule between the given super project commit and the
141- index or working tree (switched by --cached) are shown. If the option
142- --files is given, show the series of commits in the submodule between
147+ index or working tree (switched by ` --cached` ) are shown. If the option
148+ ` --files` is given, show the series of commits in the submodule between
143149 the index of the super project and the working tree of the submodule
144- (this option doesn't allow to use the --cached option or to provide an
150+ (this option doesn't allow to use the ` --cached` option or to provide an
145151 explicit commit).
152+ +
153+ Using the `--submodule=log` option with linkgit:git-diff[1] will provide that
154+ information too.
146155
147156foreach::
148157 Evaluates an arbitrary shell command in each checked out submodule.
@@ -153,9 +162,9 @@ foreach::
153162 superproject, $sha1 is the commit as recorded in the superproject,
154163 and $toplevel is the absolute path to the top-level of the superproject.
155164 Any submodules defined in the superproject but not checked out are
156- ignored by this command. Unless given --quiet, foreach prints the name
165+ ignored by this command. Unless given ` --quiet` , foreach prints the name
157166 of each submodule before evaluating the command.
158- If --recursive is given, submodules are traversed recursively (i.e.
167+ If ` --recursive` is given, submodules are traversed recursively (i.e.
159168 the given shell command is evaluated in nested submodules as well).
160169 A non-zero return from the command in any submodule causes
161170 the processing to terminate. This can be overridden by adding '|| :'
@@ -233,13 +242,18 @@ OPTIONS
233242 If the key `submodule.$name.update` is set to `rebase`, this option is
234243 implicit.
235244
245+ --init::
246+ This option is only valid for the update command.
247+ Initialize all submodules for which "git submodule init" has not been
248+ called so far before updating.
249+
236250--reference <repository>::
237251 This option is only valid for add and update commands. These
238252 commands sometimes need to clone a remote repository. In this case,
239253 this option will be passed to the linkgit:git-clone[1] command.
240254+
241255*NOTE*: Do *not* use this option unless you have read the note
242- for linkgit:git-clone[1]'s --reference and --shared options carefully.
256+ for linkgit:git-clone[1]'s ` --reference` and ` --shared` options carefully.
243257
244258--recursive::
245259 This option is only valid for foreach, update and status commands.
0 commit comments