Linux command
dvc-fetch 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Fetch all tracked data
dvc fetch
Fetch specific file
dvc fetch [data.csv.dvc]
Fetch from specific remote
dvc fetch -r [remote_name]
Fetch all revisions
dvc fetch --all-commits
Fetch with jobs
dvc fetch -j [4]
说明
dvc fetch downloads DVC-tracked data from remote storage into the local DVC cache without affecting the workspace. This is useful for preparing data for later use without immediately populating the working directory. The two-stage process (fetch then checkout) provides control over disk space and timing. Fetching brings data into cache (usually .dvc/cache) where it's stored efficiently with deduplication. A subsequent dvc checkout creates links or copies from cache to workspace when you actually need the files. This separation is particularly valuable in CI/CD pipelines or when switching between branches: you can fetch all necessary data upfront, then quickly checkout different versions as needed without repeated downloads. The --all-commits, --all-branches, and --all-tags options help prefetch data for multiple revisions in bulk.
参数
- -r, --remote _name_
- Remote storage name.
- -j, --jobs _number_
- Parallel download jobs.
- --all-commits
- Fetch for all Git commits.
- --all-branches
- Fetch for all branches.
- --all-tags
- Fetch for all tags.
- -R, --recursive
- Fetch recursively.
- --run-cache
- Fetch run history for DVC pipeline stages.
- -v, --verbose
- Increase verbosity of output.
- -q, --quiet
- Suppress output.
FAQ
What is the dvc-fetch command used for?
dvc fetch downloads DVC-tracked data from remote storage into the local DVC cache without affecting the workspace. This is useful for preparing data for later use without immediately populating the working directory. The two-stage process (fetch then checkout) provides control over disk space and timing. Fetching brings data into cache (usually .dvc/cache) where it's stored efficiently with deduplication. A subsequent dvc checkout creates links or copies from cache to workspace when you actually need the files. This separation is particularly valuable in CI/CD pipelines or when switching between branches: you can fetch all necessary data upfront, then quickly checkout different versions as needed without repeated downloads. The --all-commits, --all-branches, and --all-tags options help prefetch data for multiple revisions in bulk.
How do I run a basic dvc-fetch example?
Run `dvc fetch` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -r, --remote _name_ do in dvc-fetch?
Remote storage name.