Git serves as the standard for tracking changes in source code. However, in a machine learning project, the code is only part of the story. The data used for training is just as influential on the final model's behavior, and it changes just as often. New data is collected, labeling errors are fixed, and preprocessing steps are refined. Without a system to track these changes, the ability to reproduce results is lost.
You might be tempted to add your CSV files or image directories directly into your Git repository alongside your code. This approach, however, quickly runs into problems. Git is designed to handle text files by tracking changes line by line. It is not optimized for large, often binary, data files. Adding a 2 GB dataset to a Git repository makes it unwieldy. Operations like cloning the repository or switching branches become painfully slow for every team member, defeating the purpose of an efficient workflow.
Data versioning is the practice of tracking the state of your datasets over time, much like you track code. It allows you to reliably access any historical version of your data. Instead of storing the large data files themselves in Git, modern data versioning systems use pointers.
These systems work by storing your large data files in a separate, more appropriate location, such as cloud storage (like Amazon S3 or Google Cloud Storage) or a network drive. A small pointer file, which contains metadata and a unique identifier (a hash) for the dataset, is stored in your Git repository. This pointer file is lightweight and text-based, making it perfect for Git.
This approach elegantly separates the large, slow-moving data from the small, fast-moving code, while still using Git to link them together.
The Git repository remains small and fast, containing only code and lightweight pointer files. These pointers reference the large data files, which are stored efficiently in a separate remote storage system.
Implementing data versioning solves several common problems in machine learning projects and is a requirement for building professional-grade systems.
If you need to retrain a model from six months ago to debug an issue or satisfy an audit, how can you be sure you are using the exact same data? If the data was simply overwritten on a shared drive, you cannot. With data versioning, you can check out the specific Git commit from that time. This action restores not only the version of the code but also the pointer file, which allows you to retrieve the precise version of the dataset used for that experiment.
Imagine a new model's performance suddenly drops. Was it a code change, a bug in the feature engineering, or a shift in the input data? Data versioning helps you isolate the variable. By comparing the pointer files between the high-performing and low-performing model commits, you can quickly identify if the data changed. This lineage, linking a model to the exact code and data that produced it, is also essential for auditing and regulatory compliance.
When multiple team members work with the same dataset, it is easy for versions to diverge. One person might apply a new cleaning script while another adds new samples. Data versioning tools provide a single source of truth. Team members can pull the latest data version, create a new version with their changes, and push the new pointer file. This makes collaboration explicit and prevents the "it works on my machine" problem from extending to data.
The workflow for versioning data mirrors the Git workflow you already know for code:
data.dvc). You stage and commit this file to Git. The commit message should describe the change to the data, such as "Added July 2024 sales data."Now, anyone on your team can run git pull to get the new pointer file and then use the data versioning tool to sync their local data, downloading only the files that have changed.
By adopting this practice, you are treating your data as a first-class citizen in your development lifecycle. This structured approach is fundamental for building reliable and maintainable machine learning systems and provides a solid foundation for the next logical step: versioning the models that are created from your versioned code and data.
Was this section helpful?
© 2026 ApX Machine LearningAI Ethics & Transparency•