docs: avoid ambiguity between update and fetch (#15860)

address
<https://github.com/rust-lang/cargo/pull/15853#discussion_r2282734460>

r? epage
This commit is contained in:
Ed Page 2025-08-18 16:45:29 +00:00 committed by GitHub
commit dd69fab752
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -307,13 +307,11 @@ When cloning a `git` dependency,
Cargo automatically fetches its submodules recursively
so that all required code is available for the build.
To skip updates for a specific submodule,
Cargo respects the [`submodule.<name>.update`] setting in `.gitmodules`.
Setting it to `none` disables updates for that submodule if it isn't needed for the build.
This is usually set in the repository itself,
so changes require access to the dependency's repo.
To skip fetching submodules unrelated to the build,
you can set [`submodule.<name>.update = none`][submodule-update] in the dependency repo's `.gitmodules`.
This requires write access to the repo and will disable submodule updates more generally.
[`submodule.<name>.update`]: https://git-scm.com/docs/gitmodules#Documentation/gitmodules.txt-submodulenameupdate
[submodule-update]: https://git-scm.com/docs/gitmodules#Documentation/gitmodules.txt-submodulenameupdate
### Accessing private Git repositories