Linux command
dvc-add 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Track a file
dvc add [data.csv]
Track a directory
dvc add [data/]
Track with external storage
dvc add --external [/external/data]
说明
dvc add is the fundamental command for bringing data files under DVC version control. When you add a file, DVC computes its hash, moves it to the DVC cache, and creates a lightweight .dvc metadata file in its place. The .dvc file contains the hash and path information needed to retrieve the original file from cache or remote storage. DVC automatically adds the original filename to .gitignore so the large data file isn't committed to Git, only the small .dvc metadata file. This two-file approach allows Git to track data versions (via .dvc file) without storing the actual large files in the repository. The cached data can then be pushed to remote storage for team sharing. Directories are tracked recursively with a single .dvc file tracking all contents.
参数
- -f, --file _file_
- Specify .dvc filename.
- --external
- Track external files.
- --no-commit
- Don't auto-commit to git.
- --glob
- Use glob patterns.
FAQ
What is the dvc-add command used for?
dvc add is the fundamental command for bringing data files under DVC version control. When you add a file, DVC computes its hash, moves it to the DVC cache, and creates a lightweight .dvc metadata file in its place. The .dvc file contains the hash and path information needed to retrieve the original file from cache or remote storage. DVC automatically adds the original filename to .gitignore so the large data file isn't committed to Git, only the small .dvc metadata file. This two-file approach allows Git to track data versions (via .dvc file) without storing the actual large files in the repository. The cached data can then be pushed to remote storage for team sharing. Directories are tracked recursively with a single .dvc file tracking all contents.
How do I run a basic dvc-add example?
Run `dvc add [data.csv]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -f, --file _file_ do in dvc-add?
Specify .dvc filename.