Manually deleted .dvc files -- these files still appear to be tracked by DVC


I have manually deleted .dvc files that were previously tracked (and the tracked files themselves), expecting this to remove them from tracking (I realise now I should have used dvc gc).

My question is how do I now remove these from tracking? I cannot re-add then remove them properly as the original files are not there.

I am syncing data in two machines, on the machine I deleted the files on it says everything is up to date but on my other machine I am getting cache errors for the now deleted items. I am confused as I have pushed the deletes of the .dvc files so I assumed this would prevent them being tracked on both machines. Are they tracked somewhere else? I do not have a dvc.yaml file.



1 Like

To answer this here as well, deleting the .dvc files and then committing the git changes will work for files which were tracked with dvc add. (But prior versions of the files will still be “tracked” in your older git history.)

One other thing to note is that manually removing the .dvc files will still leave entries in your .gitignore that should also be removed. dvc remove <path_to_.dvc_file> can be used to both remove the file and cleanup the .gitignore entry.

Regarding the cache errors, this was clarified in a separate email chain to be an unrelated issue - the errors were due to files/directories which had not yet been completely dvc pushed from a coworker’s machine to a remote.