Skip to content

Commit 9d19e17

Browse files
committed
Merge branch 'pb/submodule-doc-fix'
Doc update. * pb/submodule-doc-fix: gitsubmodules doc: invoke 'ls-files' with '--recurse-submodules'
2 parents 5f8c70a + 7d15fdb commit 9d19e17

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Documentation/gitsubmodules.txt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ presence of the .url field.
225225
Workflow for a third party library
226226
----------------------------------
227227

228-
# add a submodule
228+
# Add a submodule
229229
git submodule add <url> <path>
230230

231-
# occasionally update the submodule to a new version:
231+
# Occasionally update the submodule to a new version:
232232
git -C <path> checkout <new version>
233233
git add <path>
234234
git commit -m "update submodule to new version"
@@ -246,33 +246,36 @@ Workflow for an artificially split repo
246246
# regular commands recurse into submodules by default
247247
git config --global submodule.recurse true
248248

249-
# Unlike the other commands below clone still needs
249+
# Unlike most other commands below, clone still needs
250250
# its own recurse flag:
251251
git clone --recurse <URL> <directory>
252252
cd <directory>
253253

254254
# Get to know the code:
255255
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.
257260

258261
# Get new code
259262
git fetch
260263
git pull --rebase
261264

262-
# change worktree
265+
# Change worktree
263266
git checkout
264267
git reset
265268

266269
Implementation details
267270
----------------------
268271

269272
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`
272275
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).
276279

277280

278281
SEE ALSO

0 commit comments

Comments
 (0)