Forrest logo
back to the dvc tool

dvc-gc:tldr:32f15

dvc-gc: Garbage collect from the cache, keeping only versions referenced by branch, tags, and commits.
$ dvc gc --all-branches --all-tags --all-commits
try on your machine

The command "dvc gc --all-branches --all-tags --all-commits" is related to a version control system called DVC (Data Version Control).

In DVC, "gc" stands for "garbage collection" and it is used to clean up and optimize the storage space used by the project's data files. Garbage collection removes unnecessary and unreferenced files from the DVC cache, which helps to save disk space.

Here is a breakdown of the options used in the command:

  • "--all-branches": This option specifies that garbage collection should be performed on all branches of the project. By default, DVC only performs garbage collection on the currently active branch.

  • "--all-tags": This option instructs DVC to perform garbage collection on all tags (named versions or checkpoints) in the project. Similarly to branches, DVC usually only performs garbage collection on the tags associated with the currently active branch.

  • "--all-commits": This option tells DVC to perform garbage collection on all commits in the project, including both branch commits and tag commits. By default, DVC only performs garbage collection on the latest commit.

By combining these options, the command "dvc gc --all-branches --all-tags --all-commits" ensures that garbage collection is applied to all branches, all tags, and all commits in the project. This can be useful when you want to thoroughly clean up the DVC cache across the entire project, freeing up storage space and removing unnecessary files.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the dvc tool