Git handles code, not gigabytes of data. DVC versions datasets and models alongside your code — so a git commit pins the exact data a model was trained on.
Why: Git chokes on large binary data, yet reproducing a model requires the EXACT dataset it trained on — DVC versions data by storing lightweight pointers in Git while the real bytes live in remote storage. When: use DVC for any dataset or model artifact too big or too binary for Git. Where: a git checkout of an old commit, plus dvc pull, restores the exact data of that commit.
GIT great for code, terrible for 10 GB of data
DVC tracks data as a small .dvc pointer in git;
the actual bytes live in S3/GCS/Azure/SSH remote
git commit -> pins CODE
+ dvc -> pins DATA at that commit
Together: check out any commit and get the exact code AND data.Why: dvc add replaces a large file/folder in Git with a tiny .dvc metafile that records its hash, so Git tracks the pointer and DVC tracks the content. When: run it on your raw and processed datasets, then commit the .dvc files. Where: pushing to a DVC remote uploads the actual data so teammates and CI can pull it.
pip install "dvc[s3]" # extras per remote: s3, gs, azure, ssh
dvc init # once per repo (alongside git)
dvc add data/train.csv # -> creates data/train.csv.dvc (a small pointer)
git add data/train.csv.dvc data/.gitignore
git commit -m "Track training data v1 with DVC"
dvc remote add -d storage s3://my-bucket/dvcstore
dvc push # upload the actual bytes to the remoteWhy: the payoff is time travel — checking out an old commit and running dvc pull restores the precise dataset that commit used, so a model months old is fully reproducible. When: use it to reproduce a past result or roll a dataset back. Where: the .dvc pointer in Git plus the remote content is all you need; the data itself never bloats the repo.
# Reproduce the exact data behind an old model:
git checkout <commit-from-that-run> # restores code + the .dvc pointers
dvc pull # downloads the exact data for that commit
# Switch a tracked dataset to a new version:
dvc add data/train.csv # after the file changes
git commit -am "Training data v2" # the pointer (hash) changes in git