{"id":121158,"date":"2026-07-10T12:22:11","date_gmt":"2026-07-10T06:52:11","guid":{"rendered":"https:\/\/www.guvi.in\/blog\/?p=121158"},"modified":"2026-07-10T12:22:12","modified_gmt":"2026-07-10T06:52:12","slug":"data-version-control-tutorial","status":"publish","type":"post","link":"https:\/\/www.guvi.in\/blog\/data-version-control-tutorial\/","title":{"rendered":"DVC Data Version Control Tutorial: Key Steps for ML Projects"},"content":{"rendered":"\n<p>DVC, or Data Version Control, is an open-source version control tool for data science and machine learning projects. It helps teams manage datasets, model files, pipelines, metrics, and experiments using a Git-like workflow. DVC is useful because Git is excellent for code, but it is not designed to store large datasets, trained models, feature files, or binary artifacts. DVC keeps lightweight metadata in Git and stores heavy files in local or cloud remote storage. This makes ML projects easier to reproduce, share, audit, and roll back.&nbsp;<\/p>\n\n\n\n<p><strong>TL;DR<\/strong><\/p>\n\n\n\n<ul>\n<li>DVC helps version large datasets and ML models without storing them directly in Git.<\/li>\n\n\n\n<li>It creates small .dvc metadata files that Git can track.<\/li>\n\n\n\n<li>Large files are stored in a DVC cache and can be pushed to remote storage.<\/li>\n\n\n\n<li>DVC supports remote storage options such as Amazon S3, SSH, Google Drive, Azure Blob Storage, NFS, and HDFS.&nbsp;<\/li>\n\n\n\n<li>It also supports ML pipelines, parameters, metrics, plots, and experiment comparison.&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is DVC?<\/strong><\/h2>\n\n\n\n<p>DVC, or Data Version Control, is an open-source version control system for ML datasets, model files, pipelines, and experiment outputs. It works with Git by storing lightweight metadata in the repository while keeping large files in local cache or remote storage like S3, Google Drive, Azure Blob Storage, or SSH. DVC helps teams track which data, code, parameters, and model outputs created a specific result. It also supports reproducible pipelines through dvc.yaml, dependency tracking, metrics comparison, experiment management, and remote collaboration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Top Benefits of DVC<\/strong><\/h2>\n\n\n\n<ul>\n<li><strong>Keeps Git lightweight:<\/strong> Large datasets and models stay outside Git, while metadata remains versioned.<\/li>\n\n\n\n<li><strong>Improves reproducibility:<\/strong> Teams can rebuild experiments using the same data, code, and parameters.<\/li>\n\n\n\n<li><strong>Reduces manual file sharing:<\/strong> Datasets and models can be pulled from remote storage using DVC commands.<\/li>\n\n\n\n<li><strong>Tracks data-model lineage:<\/strong> Every model result can be connected to the exact dataset and code version.<\/li>\n\n\n\n<li><strong>Simplifies experiment comparison:<\/strong> Metrics and parameters can be compared across commits and runs.<\/li>\n\n\n\n<li><strong>Makes ML projects auditable:<\/strong> Data changes, model updates, and pipeline outputs become easier to trace.<\/li>\n\n\n\n<li><strong>Fits <\/strong><a href=\"https:\/\/www.guvi.in\/blog\/what-is-mlops\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>MLOps<\/strong><\/a><strong> workflows:<\/strong> DVC supports structured data versioning, pipeline automation, and production-ready ML project management.<\/li>\n<\/ul>\n\n\n\n<div style=\"background-color: #099f4e; border: 3px solid #110053; border-radius: 12px; padding: 18px 22px; color: #FFFFFF; font-size: 18px; font-family: Montserrat, Helvetica, sans-serif; line-height: 1.6; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); max-width: 750px;\">\n  <strong style=\"font-size: 22px; color: #FFFFFF;\">\ud83d\udca1 Did You Know?<\/strong> \n  <br \/><br \/> \n  <strong style=\"color: #FFFFFF;\">DVC<\/strong> keeps your Git repo lightweight by storing only small metadata files <strong style=\"color: #FFFFFF;\">(.dvc)<\/strong>, while the actual datasets and models stay in remote storage like <strong style=\"color: #FFFFFF;\">S3<\/strong> or <strong style=\"color: #FFFFFF;\">Google Drive<\/strong>.\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Key Use Cases of DVC<\/strong><\/h2>\n\n\n\n<ul>\n<li><strong>Dataset versioning:<\/strong> Track changes in training, validation, and test datasets across ML experiments.<\/li>\n\n\n\n<li><strong>Model versioning:<\/strong> Store and manage trained model files without pushing large binaries to Git.<\/li>\n\n\n\n<li><strong>Experiment tracking:<\/strong> Compare different model runs, parameter changes, and performance metrics.<\/li>\n\n\n\n<li><strong>Team collaboration:<\/strong> Let multiple <a href=\"https:\/\/www.guvi.in\/blog\/how-to-become-a-data-scientist-from-scratch\/\" target=\"_blank\" rel=\"noreferrer noopener\">data scientists <\/a>work on the same project without manually sharing datasets.<\/li>\n\n\n\n<li><strong>Remote data storage:<\/strong> Store large files in S3, Google Drive, <a href=\"https:\/\/www.guvi.in\/blog\/azure-certification-roadmap\/\" target=\"_blank\" rel=\"noreferrer noopener\">Azure<\/a> Blob Storage, SSH, or local remote storage.<\/li>\n\n\n\n<li><strong>Rollback support:<\/strong> Return to an earlier dataset, model, or pipeline version when needed.<\/li>\n\n\n\n<li><strong>Production ML workflow:<\/strong> Maintain clean links between data versions, model artifacts, metrics, and deployment-ready outputs.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">DVC Data Version Control Tutorial: Key Steps<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install DVC<\/h3>\n\n\n\n<p>Install DVC in your <a href=\"https:\/\/www.guvi.in\/blog\/what-is-pip-in-python\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python environment using pip.<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install dvc\n<\/code><\/pre>\n\n\n\n<p>For cloud storage support, install the required extra package. For example, use this command for Amazon S3 support.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install \"dvc&#91;s3]\"\n<\/code><\/pre>\n\n\n\n<p>This prepares your project to track datasets, models, and pipeline outputs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Initialize Git and DVC<\/h3>\n\n\n\n<p>Create a new <a href=\"https:\/\/www.guvi.in\/blog\/machine-learning-pipeline\/\" target=\"_blank\" rel=\"noreferrer noopener\">ML project<\/a> folder and initialize Git.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir dvc-ml-project\ncd dvc-ml-project\ngit init\n<\/code><\/pre>\n\n\n\n<p>Now initialize DVC.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc init\n<\/code><\/pre>\n\n\n\n<p>This creates the .dvc directory and adds DVC configuration files to the project. Commit the initial setup to Git.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add .dvc .gitignore\ngit commit -m \"Initialize DVC\"\n<\/code><\/pre>\n\n\n\n<div style=\"background-color: #099f4e; border: 3px solid #110053; border-radius: 12px; padding: 18px 22px; color: #FFFFFF; font-size: 18px; font-family: Montserrat, Helvetica, sans-serif; line-height: 1.6; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); max-width: 750px;\">\n  <strong style=\"font-size: 22px; color: #FFFFFF;\">\ud83d\udca1 Did You Know?<\/strong> \n  <br \/><br \/> \n  With <strong style=\"color: #FFFFFF;\">DVC<\/strong>, switching between dataset versions is as simple as a <strong style=\"color: #FFFFFF;\">git checkout<\/strong> followed by <strong style=\"color: #FFFFFF;\">dvc pull<\/strong>, with no manual file hunting required.\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Add a Dataset to DVC<\/h3>\n\n\n\n<p>Create a dataset folder.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir data\n<\/code><\/pre>\n\n\n\n<p>Place your dataset inside the data folder. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>data\/train.csv\n<\/code><\/pre>\n\n\n\n<p>Track the dataset with DVC.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc add data\/train.csv\n<\/code><\/pre>\n\n\n\n<p>DVC creates a small metadata file named data\/train.csv.dvc. The actual dataset is stored in the DVC cache, while Git tracks only the metadata file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add data\/train.csv.dvc data\/.gitignore\ngit commit -m \"Track training dataset with DVC\"\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Configure Remote Storage<\/h3>\n\n\n\n<p>DVC remote storage is where large files are stored for sharing with teams or restoring later. DVC supports several storage types, including Amazon S3, SSH, Google Drive, Azure Blob Storage, NFS, and HDFS.<\/p>\n\n\n\n<p>For local testing, create a local remote.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir \/tmp\/dvcstore\ndvc remote add -d storage \/tmp\/dvcstore\n<\/code><\/pre>\n\n\n\n<p>For an S3 remote, use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc remote add -d storage s3:\/\/mybucket\/dvcstore\n<\/code><\/pre>\n\n\n\n<p>Commit the remote configuration.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add .dvc\/config\ngit commit -m \"Configure DVC remote storage\"\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Push Data to Remote Storage<\/h3>\n\n\n\n<p>Upload the DVC-tracked dataset to the configured remote.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc push\n<\/code><\/pre>\n\n\n\n<p>The dvc push command uploads tracked data from the local DVC cache to remote storage.<\/p>\n\n\n\n<p>Push Git metadata separately.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push\n<\/code><\/pre>\n\n\n\n<p>This separation is important. <a href=\"https:\/\/www.guvi.in\/blog\/guide-for-advanced-git-techniques\/\" target=\"_blank\" rel=\"noreferrer noopener\">Git stores<\/a> code and DVC metadata. DVC remote storage stores datasets, models, and large artifacts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Pull Data on Another Machine<\/h3>\n\n\n\n<p>Clone the Git repository on another system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone &lt;repo-url&gt;\ncd dvc-ml-project\n<\/code><\/pre>\n\n\n\n<p>Install DVC and pull the dataset.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install dvc\ndvc pull\n<\/code><\/pre>\n\n\n\n<p>The dvc pull command downloads tracked files from remote storage into the working directory.<\/p>\n\n\n\n<p>This lets another developer reproduce the same dataset state without manually sharing large files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Version Dataset Changes<\/h3>\n\n\n\n<p>Update the dataset when new rows, labels, or features are added.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc add data\/train.csv\ngit add data\/train.csv.dvc\ngit commit -m \"Update training dataset\"\ndvc push\n<\/code><\/pre>\n\n\n\n<p>Each dataset version is now linked to a Git commit. You can move between dataset versions using Git checkout and DVC pull.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git checkout &lt;commit-id&gt;\ndvc pull\n<\/code><\/pre>\n\n\n\n<p>This is useful when you need to compare model results across different <a href=\"https:\/\/www.guvi.in\/blog\/best-datasets-for-data-science-projects\/\" target=\"_blank\" rel=\"noreferrer noopener\">dataset versions.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 8: Track ML Model Files<\/h3>\n\n\n\n<p>After training a model, store the output in a model folder.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir models\n<\/code><\/pre>\n\n\n\n<p>Example model file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>models\/model.pkl\n<\/code><\/pre>\n\n\n\n<p>Track the trained model with DVC.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc add models\/model.pkl\ngit add models\/model.pkl.dvc models\/.gitignore\ngit commit -m \"Track trained model with DVC\"\ndvc push\n<\/code><\/pre>\n\n\n\n<p>This keeps large model binaries outside Git while keeping every model version traceable.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 9: Create a Reproducible DVC Pipeline<\/h3>\n\n\n\n<p>DVC can define <a href=\"https:\/\/www.guvi.in\/blog\/machine-learning-for-beginners\/\" target=\"_blank\" rel=\"noreferrer noopener\">ML pipeline<\/a> stages in dvc.yaml. A pipeline stage connects commands, dependencies, parameters, and outputs.<\/p>\n\n\n\n<p>Example training stage:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc stage add -n train \\\n  -d src\/train.py \\\n  -d data\/train.csv \\\n  -o models\/model.pkl \\\n  python src\/train.py\n<\/code><\/pre>\n\n\n\n<p>Run the pipeline.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc repro\n<\/code><\/pre>\n\n\n\n<p>The dvc repro command checks what changed and reruns only the required pipeline stages. DVC uses dvc.yaml and dvc.lock to track pipeline structure and exact output states.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 10: Track Metrics and Parameters<\/h3>\n\n\n\n<p>Create a params.yaml file for model parameters.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>train:\n  learning_rate: 0.01\n  max_depth: 5\n  n_estimators: 100\n<\/code><\/pre>\n\n\n\n<p>Create a metrics file after model evaluation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"accuracy\": 0.91,\n  \"f1_score\": 0.88\n}\n<\/code><\/pre>\n\n\n\n<p>Track metrics in Git.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add params.yaml metrics.json\ngit commit -m \"Add training parameters and metrics\"\n<\/code><\/pre>\n\n\n\n<p>DVC supports metrics in <a href=\"https:\/\/www.guvi.in\/blog\/complete-guide-on-how-to-open-a-json-file\/\" target=\"_blank\" rel=\"noreferrer noopener\">JSON<\/a>, YAML, and TOML formats, and these metrics are usually produced by training or evaluation code for experiment comparison.<\/p>\n\n\n\n<p><em>Build practical machine learning and MLOps skills with HCL GUVI\u2019s <\/em><a href=\"https:\/\/www.guvi.in\/zen-class\/machine-learning-course\/?utm_source=blog&amp;utm_medium=hyperlink&amp;utm_campaign=dvc-data-version-control-tutorial-key-steps-for-ml-projects\" target=\"_blank\" rel=\"noreferrer noopener\"><em>Machine Learning Course<\/em><\/a><em>. Learn model development, data handling, experiment workflows, deployment basics, and real-world ML practices through structured, hands-on training.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 11: Compare Model Experiments<\/h3>\n\n\n\n<p>Check current metrics.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc metrics show\n<\/code><\/pre>\n\n\n\n<p>Compare metrics between commits.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc metrics diff\n<\/code><\/pre>\n\n\n\n<p>Compare parameter changes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc params diff\n<\/code><\/pre>\n\n\n\n<p>DVC supports metrics, plots, and parameter comparison, which helps teams understand how code, data, and configuration changes affect model performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 12: Share the Complete ML Project<\/h3>\n\n\n\n<p>A complete DVC workflow has two parts.<\/p>\n\n\n\n<p>First, push code and metadata to Git.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push\n<\/code><\/pre>\n\n\n\n<p>Second, push datasets and model artifacts to DVC remote storage.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dvc push\n<\/code><\/pre>\n\n\n\n<p>A teammate can reproduce the project using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone &lt;repo-url&gt;\ndvc pull\ndvc repro\n<\/code><\/pre>\n\n\n\n<p>This creates a repeatable ML workflow where datasets, models, metrics, and pipeline outputs stay connected to the right code version.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>DVC data version control brings software engineering discipline to machine learning projects. It keeps Git lightweight, stores large files in remote storage, and tracks datasets, models, pipelines, metrics, and parameters in a reproducible way. A strong DVC workflow helps data scientists avoid broken experiments, missing datasets, unclear model versions, and manual file sharing. For ML teams, DVC is one of the most practical tools for building reliable, traceable, and production-ready machine learning workflows.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>FAQs<\/strong><\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1783329792495\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>What is DVC in machine learning?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>DVC is a data version control tool that helps machine learning teams track datasets, model files, pipelines, metrics, and experiments with a Git-like workflow.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1783329801306\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>Does DVC replace Git?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>No. DVC works with Git. Git tracks code and DVC metadata, while DVC manages large datasets, models, and pipeline outputs.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1783329813940\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \"><strong>Why use DVC for ML projects?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>DVC helps reproduce experiments, share large files, compare model metrics, version datasets, and connect every model result with the exact code and data used.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>DVC, or Data Version Control, is an open-source version control tool for data science and machine learning projects. It helps teams manage datasets, model files, pipelines, metrics, and experiments using a Git-like workflow. DVC is useful because Git is excellent for code, but it is not designed to store large datasets, trained models, feature files, [&hellip;]<\/p>\n","protected":false},"author":60,"featured_media":122548,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[294],"tags":[],"views":"43","authorinfo":{"name":"Vaishali","url":"https:\/\/www.guvi.in\/blog\/author\/vaishali\/"},"thumbnailURL":"https:\/\/www.guvi.in\/blog\/wp-content\/uploads\/2026\/07\/DVC-300x116.webp","_links":{"self":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/121158"}],"collection":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/users\/60"}],"replies":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/comments?post=121158"}],"version-history":[{"count":5,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/121158\/revisions"}],"predecessor-version":[{"id":122550,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/posts\/121158\/revisions\/122550"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/media\/122548"}],"wp:attachment":[{"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/media?parent=121158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/categories?post=121158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.guvi.in\/blog\/wp-json\/wp\/v2\/tags?post=121158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}