@@ -73,13 +73,17 @@ configuration entries unless `--name` is used to specify a logical name.
73
73
+
74
74
<repository> is the URL of the new submodule's origin repository.
75
75
This may be either an absolute URL, or (if it begins with ./
76
- or ../), the location relative to the superproject's origin
76
+ or ../), the location relative to the superproject's default remote
77
77
repository (Please note that to specify a repository 'foo.git'
78
78
which is located right next to a superproject 'bar.git', you'll
79
79
have to use '../foo.git' instead of './foo.git' - as one might expect
80
80
when following the rules for relative URLs - because the evaluation
81
81
of relative URLs in Git is identical to that of relative directories).
82
- If the superproject doesn't have an origin configured
82
+ +
83
+ The default remote is the remote of the remote tracking branch
84
+ of the current branch. If no such remote tracking branch exists or
85
+ the HEAD is detached, "origin" is assumed to be the default remote.
86
+ If the superproject doesn't have a default remote configured
83
87
the superproject is its own authoritative upstream and the current
84
88
working directory is used instead.
85
89
+
@@ -118,18 +122,24 @@ too (and can also report changes to a submodule's work tree).
118
122
119
123
init [--] [<path>...]::
120
124
Initialize the submodules recorded in the index (which were
121
- added and committed elsewhere) by copying submodule
122
- names and urls from .gitmodules to .git/config.
123
- Optional <path> arguments limit which submodules will be initialized.
124
- It will also copy the value of `submodule.$name.update` into
125
- .git/config.
126
- The key used in .git/config is `submodule.$name.url`.
127
- This command does not alter existing information in .git/config.
128
- You can then customize the submodule clone URLs in .git/config
129
- for your local setup and proceed to `git submodule update`;
130
- you can also just use `git submodule update --init` without
131
- the explicit 'init' step if you do not intend to customize
132
- any submodule locations.
125
+ added and committed elsewhere) by setting `submodule.$name.url`
126
+ in .git/config. It uses the same setting from .gitmodules as
127
+ a template. If the URL is relative, it will be resolved using
128
+ the default remote. If there is no default remote, the current
129
+ repository will be assumed to be upstream.
130
+ +
131
+ Optional <path> arguments limit which submodules will be initialized.
132
+ If no path is specified, all submodules are initialized.
133
+ +
134
+ When present, it will also copy the value of `submodule.$name.update`.
135
+ This command does not alter existing information in .git/config.
136
+ You can then customize the submodule clone URLs in .git/config
137
+ for your local setup and proceed to `git submodule update`;
138
+ you can also just use `git submodule update --init` without
139
+ the explicit 'init' step if you do not intend to customize
140
+ any submodule locations.
141
+ +
142
+ See the add subcommand for the defintion of default remote.
133
143
134
144
deinit [-f|--force] (--all|[--] <path>...)::
135
145
Unregister the given submodules, i.e. remove the whole
0 commit comments