specify remote when adding file to dvc repo
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.9k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Currently, one can add a file to dvc via dvc add some.file which will create a tracking file some.file.dvc. In this tracking file, one can add remote: some_remote to the fields, to tell dvc which remote to synchronize with (cf. docs). I would like to be able to do that from the command line per some argument to dvc add. The command already has argument -r/--remote (although currently only allowed in combination with --to-remote. It'd be great if it could be used for this purpose.
What I'm suggesting in code:
dvc add test.txt --remote foo should yield a file with this content
outs:
- md5: <SOME_HASH>
size: <SOME_SIZE>
path: test.txt
remote: foo
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation and tests for the dvc add command, especially its existing --remote handling with --to-remote. Trace how command options become the .dvc YAML output, then verify that dvc add test.txt --remote foo records remote: foo while existing behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100