Forrest logo
back to the dvc tool

dvc-gc:tldr:72386

dvc-gc: Garbage collect from the cache, keeping only versions referenced by the current workspace.
$ dvc gc --workspace
try on your machine

The command "dvc gc --workspace" is used in DVC (Data Version Control) to perform garbage collection within a specific workspace.

In DVC, a workspace is a directory or folder where you work on your data and keep track of its versions using DVC. Garbage collection, in this context, refers to the process of removing unnecessary files and directories that are no longer referenced or needed by DVC.

When you run the "dvc gc --workspace" command, it will analyze the workspace and identify any unreferenced files or directories associated with DVC. These unreferenced files are typically ones that were used in previous versions of your data but are no longer needed.

The command will then remove these unreferenced files and directories, freeing up storage space and ensuring that your workspace stays clean and efficient.

It's important to note that the "--workspace" flag specifies that the garbage collection should only be performed within the current workspace. If you omit this flag, the command will run across all workspaces in your DVC project.

Overall, the "dvc gc --workspace" command helps to declutter your workspace by removing unnecessary files, optimizing storage, and maintaining the integrity of your DVC project.

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