Remove all DVC files and directories from a DVC project.
usage: dvc destroy [-h] [-q | -v] [-f]dvc destroy removes dvc.yaml, .dvc files, and the internal .dvc/
directory from the workspace.
Note that the cache directory will be removed as well, unless it's
set to an external location
(by default a local cache is located in .dvc/cache). If you were using
symlinks for linking data from the
cache, DVC will replace them with the latest versions of the actual files and
directories first, so that your data is intact after the project's destruction.
Refer to DVC files and directories for more details on the directories and files deleted by this command.
-f, --force - do not prompt when destroying this project.-h, --help - prints the usage/help message, and exit.-q, --quiet - do not write anything to standard output. Exit with 0 if no
problems arise, otherwise 1.-v, --verbose - displays detailed tracing information.$ dvc init
$ echo foo > foo
$ dvc add foo
$ ls -a
.dvc .git code.py foo foo.dvc
$ dvc destroy
This will destroy all information about your pipelines, all data files...
Are you sure you want to continue?
yes
$ ls -a
.git code.py fooBy default, the cache location is .dvc/cache. Let's change the
cache location to /mnt/cache and then execute dvc destroy command:
$ dvc init
$ echo foo > foo
$ dvc cache dir /mnt/cache
$ dvc add foodvc cache dir changed the location of the cache directory to an external
location. Content of workspace:
$ ls -a
.dvc .git code.py foo foo.dvcContent of /mnt/cache directory:
$ tree /mnt/cache
/mnt/cache/
โโโ b1
โโโ 946ac92492d2347c6235b4d2611184Let's execute dvc destroy:
$ dvc destroy
This will destroy all information about your pipelines, all data files...
Are you sure you want to continue? [y/n]
yes
$ ls -a
.git code.py foodvc destroy command removed DVC-files, and the internal .dvc/ directory from
the workspace. But the cache files that are present in the
/mnt/cache directory still persist:
$ tree /mnt/cache
/mnt/cache/
โโโ b1
โโโ 946ac92492d2347c6235b4d2611184