treeverse / treeverse/dvc

specify remote when adding file to dvc repo

Open
#9,352 19 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A: data-management feature request
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.