Documentation: update add --force option + ignore=all config

- git-add.adoc: Update the --force documentation for submodule behaviour to be added even the given configuration ignore=all. - gitmodules.adoc and config/submodule.adoc: The submodule config ignore=all now need --force in order to update the index. Signed-off-by: Claus Schneider(Eficode) <claus.schneider@eficode.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Claus Schneider(Eficode) committed Feb 6, 2026 at 13:23 UTC 6cc6d1b4c699323bc2a76e1a4cfbaede242cbfc8
3 files changed +15 -8
Documentation/config/submodule.adoc
+7 -6
@@ -32,15 +32,16 @@ submodule.<name>.fetchRecurseSubmodules::
32
33 submodule.<name>.ignore::
34 Defines under what circumstances "git status" and the diff family show
35 - a submodule as modified. When set to "all", it will never be considered
36 - modified (but it will nonetheless show up in the output of status and
37 - commit when it has been staged), "dirty" will ignore all changes
38 - to the submodule's work tree and
35 + a submodule as modified.
36 + When set to "all" will never consider the submodule modified. It can
37 + nevertheless be staged using the option --force and it will then show up
38 + in the output of status.
39 + When set to "dirty" will ignore all changes to the submodule's work tree and
40 takes only differences between the HEAD of the submodule and the commit
41 recorded in the superproject into account. "untracked" will additionally
42 let submodules with modified tracked files in their work tree show up.
42 - Using "none" (the default when this option is not set) also shows
43 - submodules that have untracked files in their work tree as changed.
43 + When set to "none"(default) It also show submodules as changed if they have
44 + untracked files in their work tree.
45 This setting overrides any setting made in .gitmodules for this submodule,
46 both settings can be overridden on the command line by using the
47 "--ignore-submodules" option. The 'git submodule' commands are not
Documentation/git-add.adoc
+4 -1
@@ -75,7 +75,10 @@ in linkgit:gitglossary[7].
75
76 `-f`::
77 `--force`::
78 - Allow adding otherwise ignored files.
78 + Allow adding otherwise ignored files. The option is also used when
79 + `submodule.<name>.ignore=all` is set, but you want to stage an
80 + update of the submodule. The `path` to the submodule must be explicitly
81 + specified.
82
83 `--sparse`::
84 Allow updating index entries outside of the sparse-checkout cone.
Documentation/gitmodules.adoc
+4 -1
@@ -70,7 +70,10 @@ submodule.<name>.ignore::
70 --
71 all;; The submodule will never be considered modified (but will
72 nonetheless show up in the output of status and commit when it has
73 - been staged).
73 + been staged). Add `(new commits)` can be overruled using the
74 + `git add --force <submodule.path>`.
75 + The setting affects `status`, `update-index`, `diff` and `log`(due
76 + to underlaying `diff`).
77
78 dirty;; All changes to the submodule's work tree will be ignored, only
79 committed differences between the `HEAD` of the submodule and its