Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5325 : added --keep flag to dvc exp remove documentation #5326

Merged
merged 5 commits into from
Dec 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion content/docs/command-reference/exp/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Delete specific experiments from the <abbr>project</abbr>.

```usage
usage: dvc exp remove [-h] [-q | -v] [-A] [--rev <commit>] [-n <num>]
[--queue | -g <git_remote>]
[--queue | -g <git_remote>] [--keep]
[<name> [<name> ...]]

positional arguments:
Expand Down Expand Up @@ -40,6 +40,10 @@ With `--queue`, the list of experiments awaiting execution is cleared instead.
- `-g`, `--git-remote` - Name or URL of the Git remote to remove the experiment
from

- `--keep` - changes the default behavior to the opposite for options like `-n`,
`--rev`. For example `-n <num> --keep` keeps experiments from the last `num`
commits and removes all other experiments.

- `-h`, `--help` - shows the help message and exit.

- `-q`, `--quiet` - do not write anything to standard output. Exit with 0 if no
Expand Down Expand Up @@ -121,3 +125,25 @@ $ dvc exp list myremote
master:
conic-ease
```

Conversely, to keep only specific experiments (and remove all others), give
their names to `dvc exp remove` with the `--keep` flag :

```cli
$ dvc exp list
master:
major-mela
conic-ease
lucid-lair

$ dvc exp remove --keep major-mela

$ dvc exp list
master:
major-mela

```

In this case, the experiments named `conic-ease` and `lucid-lair` are removed,
and only `major-mela` is kept. The `--keep` flag also works with `--num` (`-n`)
and `--rev`, but _not_ with `--queue`.