@@ -225,10 +225,10 @@ presence of the .url field.
225
225
Workflow for a third party library
226
226
----------------------------------
227
227
228
- # add a submodule
228
+ # Add a submodule
229
229
git submodule add <url> <path>
230
230
231
- # occasionally update the submodule to a new version:
231
+ # Occasionally update the submodule to a new version:
232
232
git -C <path> checkout <new version>
233
233
git add <path>
234
234
git commit -m "update submodule to new version"
@@ -246,33 +246,36 @@ Workflow for an artificially split repo
246
246
# regular commands recurse into submodules by default
247
247
git config --global submodule.recurse true
248
248
249
- # Unlike the other commands below clone still needs
249
+ # Unlike most other commands below, clone still needs
250
250
# its own recurse flag:
251
251
git clone --recurse <URL> <directory>
252
252
cd <directory>
253
253
254
254
# Get to know the code:
255
255
git grep foo
256
- git ls-files
256
+ git ls-files --recurse-submodules
257
+
258
+ [NOTE]
259
+ `git ls-files` also requires its own `--recurse-submodules` flag.
257
260
258
261
# Get new code
259
262
git fetch
260
263
git pull --rebase
261
264
262
- # change worktree
265
+ # Change worktree
263
266
git checkout
264
267
git reset
265
268
266
269
Implementation details
267
270
----------------------
268
271
269
272
When cloning or pulling a repository containing submodules the submodules
270
- will not be checked out by default; You can instruct ' clone' to recurse
271
- into submodules. The ' init' and ' update' subcommands of ' git submodule'
273
+ will not be checked out by default; you can instruct ` clone` to recurse
274
+ into submodules. The ` init` and ` update` subcommands of ` git submodule`
272
275
will maintain submodules checked out and at an appropriate revision in
273
- your working tree. Alternatively you can set ' submodule.recurse' to have
274
- ' checkout' recursing into submodules (note that ' submodule.recurse' also
275
- affects other git commands, see linkgit:git-config[1] for a complete list).
276
+ your working tree. Alternatively you can set ` submodule.recurse` to have
277
+ ` checkout` recursing into submodules (note that ` submodule.recurse` also
278
+ affects other Git commands, see linkgit:git-config[1] for a complete list).
276
279
277
280
278
281
SEE ALSO
0 commit comments