There are situations where you may want to "un-track" files or directories added in error to DVC.
data.csv
fileLet's undo dvc add
with dvc remove
. This deletes the .dvc
file (and
corresponding .gitignore
entry). The data file is now no longer being tracked
after this:
$ dvc remove data.csv.dvc
$ git status
Untracked files:
data.csv
You can run dvc gc
with the -w
option to remove the data (and all of it's
previous versions, if any) from the cache:
$ dvc gc -w
Note that a very similar procedure works for
dvc.yaml
stages and their outputs.