Skip to content

Commit 62537dd

Browse files
authored
docs: mention how Cargo fetch git submodules (#15853)
### What does this PR try to resolve? Clarify how git submodules are handled in Cargo for `git` dependencies. See #4247 (comment)
2 parents 33cb1c2 + 65e7c7a commit 62537dd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/doc/src/reference/specifying-dependencies.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,20 @@ See [Multiple locations](#multiple-locations) section below for detailed explana
301301
> locations](#multiple-locations) section for a fallback alternative for `git`
302302
> and `path` dependencies.
303303
304+
### Git submodules
305+
306+
When cloning a `git` dependency,
307+
Cargo automatically fetches its submodules recursively
308+
so that all required code is available for the build.
309+
310+
To skip updates for a specific submodule,
311+
Cargo respects the [`submodule.<name>.update`] setting in `.gitmodules`.
312+
Setting it to `none` disables updates for that submodule if it isn't needed for the build.
313+
This is usually set in the repository itself,
314+
so changes require access to the dependency's repo.
315+
316+
[`submodule.<name>.update`]: https://git-scm.com/docs/gitmodules#Documentation/gitmodules.txt-submodulenameupdate
317+
304318
### Accessing private Git repositories
305319

306320
See [Git Authentication](../appendix/git-authentication.md) for help with Git authentication for private repos.

0 commit comments

Comments
 (0)