datalad remove(1) | General Commands Manual | datalad remove(1) |
datalad remove - remove components from datasets
datalad remove [-h] [-d DATASET] [--drop {datasets|all}] [--reckless {modification|availability|undead|kill}] [-m MESSAGE] [-J NJOBS] [--recursive] [--nocheck] [--nosave] [--if-dirty IF_DIRTY] [--version] [PATH ...]
Removing "unlinks" a dataset component, such as a file or subdataset, from a dataset. Such a removal advances the state of a dataset, just like adding new content. A remove operation can be undone, by restoring a previous dataset state, but might require re-obtaining file content and subdatasets from remote locations.
This command relies on the 'drop' command for safe operation. By default, only file content from datasets which will be uninstalled as part of a removal will be dropped. Otherwise file content is retained, such that restoring a previous version also immediately restores file content access, just as it is the case for files directly committed to Git. This default behavior can be changed to always drop content prior removal, for cases where a minimal storage footprint for local datasets installations is desirable.
Removing a dataset component is always a recursive operation. Removing a directory, removes all content underneath the directory too. If subdatasets are located under a to-be-removed path, they will be uninstalled entirely, and all their content dropped. If any subdataset can not be uninstalled safely, the remove operation will fail and halt.
Changed in version 0.16
More in-depth and comprehensive safety-checks are now performed by
default.
The ``--if-dirty`` argument is ignored, will be removed in
a future release, and can be removed for a safe-by-default behavior. For
other cases consider the ``--reckless`` argument.
The ``--save`` argument is ignored and will be removed in a future
release, a dataset modification is now always saved. Consider save's
``--amend`` argument for post-remove fix-ups.
The ``--recursive`` argument is ignored, and will be removed
in a future release. Removal operations are always recursive, and the
parameter can be stripped from calls for a safe-by-default behavior.
Deprecated in version 0.16
The ``--check`` argument will be removed in a future release.
It needs to be replaced with ``--reckless``.
Permanently remove a subdataset (and all further subdatasets contained in it) from a dataset::
% datalad remove -d <path/to/dataset> <path/to/subds>
Permanently remove a superdataset (with all subdatasets) from the filesystem::
% datalad remove -d <path/to/dataset>
DANGER-ZONE: Fast wipe-out a dataset and all its subdataset, bypassing all safety checks::
% datalad remove -d <path/to/dataset> --reckless kill
datalad is developed by The DataLad Team and Contributors <team@datalad.org>.
2023-01-25 | datalad remove 0.18.1 |