Skip to content

Commit

Permalink
Fix #5325 : added --keep flag to dvc exp remove documentation (#5326)
Browse files Browse the repository at this point in the history
* added --keep flag to dvc exp remove

* Fixed doc for --keep as mentioned in #5326 (comment)

* Added examples

* prettier code style - formatting issues fixed

---------

Co-authored-by: Ivan Shcheklein <[email protected]>
  • Loading branch information
rmic and shcheklein authored Dec 1, 2024
1 parent 9539e89 commit 3017c58
Showing 1 changed file with 27 additions and 1 deletion.
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`.

0 comments on commit 3017c58

Please sign in to comment.