Skip to content

Commit 3244eb9

Browse files
daleworleygitster
authored andcommitted
git-submodule.txt: Clarify 'init' and 'add' subcommands.
Describe how 'add' sets the submodule's logical name, which is used in the configuration entry names. Clarify that 'init' only sets up the configuration entries for submodules that have already been added elsewhere. Describe that <path> arguments limit the submodules that are configured. Signed-off-by: Dale Worley <[email protected]> Acked-by: Jens Lehmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4f4e7e9 commit 3244eb9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Documentation/git-submodule.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ argument <path> is the relative location for the cloned submodule
7777
to exist in the superproject. If <path> is not given, the
7878
"humanish" part of the source repository is used ("repo" for
7979
"/path/to/repo.git" and "foo" for "host.xz:foo/.git").
80+
The <path> is also used as the submodule's logical name in its
81+
configuration entries unless `--name` is used to specify a logical name.
8082
+
8183
<repository> is the URL of the new submodule's origin repository.
8284
This may be either an absolute URL, or (if it begins with ./
@@ -124,8 +126,10 @@ linkgit:git-status[1] and linkgit:git-diff[1] will provide that information
124126
too (and can also report changes to a submodule's work tree).
125127

126128
init::
127-
Initialize the submodules, i.e. register each submodule name
128-
and url found in .gitmodules into .git/config.
129+
Initialize the submodules recorded in the index (which were
130+
added and committed elsewhere) by copying submodule
131+
names and urls from .gitmodules to .git/config.
132+
Optional <path> arguments limit which submodules will be initialized.
129133
It will also copy the value of `submodule.$name.update` into
130134
.git/config.
131135
The key used in .git/config is `submodule.$name.url`.

0 commit comments

Comments
 (0)