Skip to content

specify remote when adding file to dvc repo #9352

Open
@christian-steinmeyer

Description

@christian-steinmeyer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A: data-managementRelated to dvc add/checkout/commit/move/removefeature requestRequesting a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions