Tracking Data Changes with DVC
What you'll learn: How to version your datasets and keep them synchronized across your team using DVC's core commands.
The Core Workflow
Once you've configured DVC remote storage, you need three essential commands to track and share data changes: dvc add, dvc push, and dvc pull. Think of these as Git's add, push, and pull, but specifically designed for large datasets that don't belong in your code repository.
Adding and Tracking Data
When you run dvc add data/train.csv, DVC computes a hash of your file's contents, stores that hash in a .dvc file (which you commit to Git), and moves the actual data to DVC's cache. This creates a lightweight pointer in your Git repository while keeping the heavy data separate.
dvc add data/train.csv
git add data/train.csv.dvc .gitignore
git commit -m "Track training dataset v1"
Synchronizing with Remote Storage
After tracking files locally, dvc push uploads your dataset to the configured remote storage (like S3 or Google Cloud Storage). This is how you share data with teammates:
dvc push
When a colleague clones your repository, they'll see the .dvc pointer files but not the actual data. Running dvc pull downloads the datasets from remote storage to their local cache:
dvc pull
This workflow separates lightweight metadata (tracked in Git) from heavy data (stored remotely), enabling efficient collaboration without bloating your repository.
Key Takeaway: dvc add versions your data locally, dvc push uploads it to shared storage, and dvc pull downloads versioned data—together they create a Git-like workflow for dataset collaboration.