Remove stages from
dvc.yaml and/or stop tracking files or directories (and
optionally delete them).
Note that the actual output files or directories of the stage
outs field) are not removed by this command, unless the
--outs option is
💡 Refer to Undo Adding Data to see how it helps replace data that is tracked by DVC.
--outs- remove the outputs of any
⚠️This option may be irreversible (e.g. if the data isn't cached).
--help- prints the usage/help message, and exit.
--quiet- do not write anything to standard output. Exit with 0 if no problems arise, otherwise 1.
--verbose- displays detailed tracing information.
Let's imagine we have
bar.csv files, that are already
tracked by DVC:
$ ls bar.csv bar.csv.dvc foo.csv foo.csv.dvc $ cat .gitignore /foo.csv /bar.csv
foo.csv.dvc and double checks that its entry is gone from
$ dvc remove foo.csv.dvc $ ls bar.csv bar.csv.dvc foo.csv $ cat .gitignore /bar.csv
The same procedure applies to tracked directories.
Let's imagine we have a
train stage in
dvc.yaml, and corresponding files in
train: cmd: python train.py data.csv deps: - data.csv - train.py outs: - model
$ ls dvc.lock dvc.yaml foo.csv foo.csv.dvc model train.py
$ dvc remove train --outs $ ls dvc.lock dvc.yaml foo.csv foo.csv.dvc train.py
Notice that the dependencies (
train.py) are not deleted.