@@ -154,27 +154,51 @@ If `--force` is specified, the submodule's work tree will be removed even if
154154it contains local modifications.
155155
156156update::
157- Update the registered submodules, i.e. clone missing submodules and
158- checkout the commit specified in the index of the containing repository.
159- This will make the submodules HEAD be detached unless `--rebase` or
160- `--merge` is specified or the key `submodule.$name.update` is set to
161- `rebase`, `merge` or `none`. `none` can be overridden by specifying
162- `--checkout`. Setting the key `submodule.$name.update` to `!command`
163- will cause `command` to be run. `command` can be any arbitrary shell
164- command that takes a single argument, namely the sha1 to update to.
165157+
158+ --
159+ Update the registered submodules to match what the superproject
160+ expects by cloning missing submodules and updating the working tree of
161+ the submodules. The "updating" can be done in several ways depending
162+ on command line options and the value of `submodule.<name>.update`
163+ configuration variable. Supported update procedures are:
164+
165+ checkout;; the commit recorded in the superproject will be
166+ checked out in the submodule on a detached HEAD. This is
167+ done when `--checkout` option is given, or no option is
168+ given, and `submodule.<name>.update` is unset, or if it is
169+ set to 'checkout'.
170+ +
171+ If `--force` is specified, the submodule will be checked out (using
172+ `git checkout --force` if appropriate), even if the commit specified
173+ in the index of the containing repository already matches the commit
174+ checked out in the submodule.
175+
176+ rebase;; the current branch of the submodule will be rebased
177+ onto the commit recorded in the superproject. This is done
178+ when `--rebase` option is given, or no option is given, and
179+ `submodule.<name>.update` is set to 'rebase'.
180+
181+ merge;; the commit recorded in the superproject will be merged
182+ into the current branch in the submodule. This is done
183+ when `--merge` option is given, or no option is given, and
184+ `submodule.<name>.update` is set to 'merge'.
185+
186+ custom command;; arbitrary shell command that takes a single
187+ argument (the sha1 of the commit recorded in the
188+ superproject) is executed. This is done when no option is
189+ given, and `submodule.<name>.update` has the form of
190+ '!command'.
191+
192+ When no option is given and `submodule.<name>.update` is set to 'none',
193+ the submodule is not updated.
194+
166195If the submodule is not yet initialized, and you just want to use the
167196setting as stored in .gitmodules, you can automatically initialize the
168197submodule with the `--init` option.
169- +
198+
170199If `--recursive` is specified, this command will recurse into the
171200registered submodules, and update any nested submodules within.
172- +
173- If `--force` is specified, the submodule will be checked out (using
174- `git checkout --force` if appropriate), even if the commit specified in the
175- index of the containing repository already matches the commit checked out in
176- the submodule.
177-
201+ --
178202summary::
179203 Show commit summary between the given commit (defaults to HEAD) and
180204 working tree/index. For a submodule in question, a series of commits
@@ -238,10 +262,12 @@ OPTIONS
238262 When running add, allow adding an otherwise ignored submodule path.
239263 When running deinit the submodule work trees will be removed even if
240264 they contain local changes.
241- When running update, throw away local changes in submodules when
242- switching to a different commit; and always run a checkout operation
243- in the submodule, even if the commit listed in the index of the
244- containing repository matches the commit checked out in the submodule.
265+ When running update (only effective with the checkout procedure),
266+ throw away local changes in submodules when switching to a
267+ different commit; and always run a checkout operation in the
268+ submodule, even if the commit listed in the index of the
269+ containing repository matches the commit checked out in the
270+ submodule.
245271
246272--cached::
247273 This option is only valid for status and summary commands. These
@@ -302,7 +328,7 @@ the submodule itself.
302328 Checkout the commit recorded in the superproject on a detached HEAD
303329 in the submodule. This is the default behavior, the main use of
304330 this option is to override `submodule.$name.update` when set to
305- `merge`, `rebase` or `none `.
331+ a value other than `checkout `.
306332 If the key `submodule.$name.update` is either not explicitly set or
307333 set to `checkout`, this option is implicit.
308334
0 commit comments