Description
Thedvc destroy command removes all DVC-related files from your project, including the .dvc directory, configuration files, and local cache. This effectively uninitializes DVC from your repository.
Usage
Arguments
This command takes no arguments.Options
flag
Force destruction without asking for confirmation.By default, DVC asks for user confirmation before destroying the repository. Use this flag to skip the confirmation prompt (useful for automation).
What Gets Deleted
When you rundvc destroy, the following are permanently removed:
.dvc/ Directory
.dvc/ Directory
The entire
.dvc directory, including:- Configuration files (
.dvc/config,.dvc/config.local) - Local cache (
.dvc/cache/) - Temporary files
- Internal state files
Pipeline Information
Pipeline Information
All information about your data pipelines:
- Stage definitions in
dvc.yaml - Pipeline dependencies and outputs
- Metrics and plots configurations
Local Cache
Local Cache
All cached data files:
- Original versions of tracked files
- Historical versions from previous commits
- Cached pipeline outputs
What is NOT deleted:
.dvcfiles (e.g.,data.csv.dvc) - These remain as regular files in your Git repository- Remote storage - Data in remote storage (S3, GCS, etc.) is unaffected
- Git repository - Your Git history and tracked files remain intact
Examples
Destroy with Confirmation
Destroy Without Confirmation
Before You Destroy
1
Backup to Remote
Ensure all important data is pushed to remote storage:
2
Check Status
Verify no uncommitted changes:
3
Document Configuration
Save your DVC configuration if you might need it later:
4
List Tracked Files
Document what files are tracked by DVC:
After Destruction
After runningdvc destroy:
Project State
Cleanup Git Repository
You may want to remove DVC-related files from Git:Reinitialize DVC
If you want to start fresh:Use Cases
Switch to Different Tool
Remove DVC when migrating to a different data versioning solution.
Clean Installation
Start fresh with a clean DVC setup after configuration issues.
Remove from Project
Permanently remove DVC from a project that no longer needs it.
Testing & Development
Quickly reset DVC state during testing or development.
Safety Checks
Dry Run Alternative
DVC destroy doesn’t have a dry-run option, but you can check what would be deleted:Verify Remote Backup
Before destroying, verify your data is safely in remote storage:Comparison: destroy vs. remove
Recovery After Accidental Destroy
If you accidentally destroyed DVC:1
Reinitialize DVC
2
Restore Configuration
If you have a backup of your config:Or restore from Git history:
3
Pull Data from Remote
4
Verify Status
As long as you have:
.dvcfiles in Gitdvc.yaml(if using pipelines)- Data in remote storage
dvc pull.Troubleshooting
Permission Denied
Not a DVC Repository
- Navigate to the correct directory
- DVC may already be destroyed
Files in Use
Automation Example
CI/CD Pipeline Cleanup
Related Commands
dvc init- Initialize DVC (opposite of destroy)dvc push- Upload data to remote before destroyingdvc status --cloud- Check if data is backed up to remotedvc remove- Remove specific DVC-tracked files (not entire setup)dvc gc- Clean up cache without destroying DVC setup