Dvc: move: rename an existing .dvc file

Created on 15 Nov 2018  路  1Comment  路  Source: iterative/dvc

I executed a few dvc run ... commands without knowing I could use the flag -f to name the resulting .dvc file. I would like to keep things tidy, hence was wondering how could I rename such .dvc files without breaking reproducibility in the future running dvc repro. Shall I use dvc move <fname>.dvc <new_name>.dvc?

question

Most helpful comment

Hi @IamGianluca !

Unfortunately dvc move currently only supports stages created by dvc add, because those don't have commands in them, which make moving a little bit more complicated. I have created https://github.com/iterative/dvc/issues/1332 to track progress on adding support for dvc run stages to dvc move, will try to send a patch for it ASAP.

If you want to rename it without moving to another directory you can simply use mv fname.dvc new_fname.dvc. Otherwise you will need to also edit that dvc file to make sure that your command and paths are specified relative to the new dvcfile location. Basically dvc doesn't care how your dvcfiles are named as long as they have .dvc suffix, which is used to discover dvcfiles in a repository and build DAG based on it.

Thanks,
Ruslan

>All comments

Hi @IamGianluca !

Unfortunately dvc move currently only supports stages created by dvc add, because those don't have commands in them, which make moving a little bit more complicated. I have created https://github.com/iterative/dvc/issues/1332 to track progress on adding support for dvc run stages to dvc move, will try to send a patch for it ASAP.

If you want to rename it without moving to another directory you can simply use mv fname.dvc new_fname.dvc. Otherwise you will need to also edit that dvc file to make sure that your command and paths are specified relative to the new dvcfile location. Basically dvc doesn't care how your dvcfiles are named as long as they have .dvc suffix, which is used to discover dvcfiles in a repository and build DAG based on it.

Thanks,
Ruslan

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TezRomacH picture TezRomacH  路  3Comments

prihoda picture prihoda  路  3Comments

tc-ying picture tc-ying  路  3Comments

shcheklein picture shcheklein  路  3Comments

dnabanita7 picture dnabanita7  路  3Comments