Skip to main content

How to Download DVC Data After Cloning with dvc pull

· 9 min read
Jagdish Kumawat
Founder @ Dewiride

Clone a DVC project with Git, and you get its code and its .dvc files, but not its data: the data lives in the project's DVC remote. dvc pull downloads it. This guide clones a small project, pulls its data with DVC 3.67.1, and fixes the error you get when the data was never pushed.

Syntax​

Syntax
dvc pull [-r <remote>] [<targets>]
PartWhat it means
dvc pullDownloads the data the .dvc files point to, from the remote into the cache, and puts it in the project folder
-r <remote>Optional: the remote to download from. Without it, DVC uses the default remote saved in .dvc/config
<targets>Optional: only these files, folders or .dvc files. Without them, DVC downloads everything the project tracks

The dvc pull reference says it "downloads tracked data from a dvc remote to the cache, and links (or copies) the files or directories to the workspace", and that "It has the same effect as running dvc fetch and dvc checkout".

The Example​

river-levels is a DVC project on this computer. Its data/levels.csv, a river's daily water level, is tracked with dvc add, its default remote is a folder in the home folder, and the data has been pushed there. This guide clones it into river-levels-copy.

Prerequisites​

  • DVC. Run dvc --version to check; this guide uses DVC 3.67.1.
  • Access to the project's DVC remote. dvc remote list in the clone shows where it is. For a folder, the same path must exist on your computer.

Step 1: Clone the Project​

Terminal
git clone river-levels river-levels-copy
Output
Cloning into 'river-levels-copy'...
done.

A real project is usually cloned from a web address, such as a GitHub repository. Here it's a folder on the same computer, which works the same way; How to Clone a Local Git Repository into Another Folder explains it. Move into the clone and list its data folder:

Terminal
cd river-levels-copy
ls -a data
Output
. .. .gitignore levels.csv.dvc

The terminal after git clone river-levels river-levels-copy and ls -a data in the clone: only .gitignore and levels.csv.dvc, without levels.csv.

levels.csv.dvc is there, but levels.csv isn't: Git never had it, because dvc add put it in data/.gitignore.

Step 2: Pull the Data​

Terminal
dvc pull
Output
Collecting |1.00 [00:00, 648entry/s]
Fetching
Building workspace index |1.00 [00:00, 244entry/s]
Comparing indexes |3.00 [00:00, 2.93kentry/s]
Applying changes |1.00 [00:00, 805file/s]
A data/levels.csv
1 file fetched and 1 file added

The terminal after dvc pull: progress bars for Collecting, Fetching, Building workspace index, Comparing indexes and Applying changes, then A data/levels.csv and 1 file fetched and 1 file added.

The lines follow the two halves of the command:

  • Collecting and Fetching are dvc fetch: DVC listed the files the .dvc files point to and downloaded the missing ones from the remote into the clone's cache.
  • Building workspace index, Comparing indexes and Applying changes are dvc checkout: DVC compared the project folder with what the .dvc files describe and put the missing file in place.
  • A data/levels.csv means the file was added to the project folder.

The command is the same in PowerShell.

Step 3: Check the Data​

Terminal
ls -a data
Output
. .. .gitignore levels.csv levels.csv.dvc

levels.csv is there now. Read it, with a command that's the same in PowerShell:

Terminal
cat data/levels.csv
Output
date,station,level_m
2026-11-01,Bridge Street,1.42
2026-11-02,Bridge Street,1.57
2026-11-03,Bridge Street,1.61

dvc status confirms that the data matches the .dvc files:

Terminal
dvc status
Output
Data and pipelines are up to date.

The terminal after ls -a data, which now lists levels.csv, cat data/levels.csv, which prints three days of water levels, and dvc status, which says Data and pipelines are up to date.

Step 4: Pull Again​

Terminal
dvc pull
Output
Collecting |1.00 [00:00, 508entry/s]
Fetching
Building workspace index |2.00 [00:00, 1.05kentry/s]
Comparing indexes |3.00 [00:00, 3.16kentry/s]
Applying changes |0.00 [00:00, ?file/s]
Everything is up to date.

The terminal after a second dvc pull: Applying changes counts 0 files, and the last line is Everything is up to date.

Nothing was missing, so nothing was downloaded. Run dvc pull whenever git pull brings new .dvc files, and it downloads only the data that changed.

Error: The Data Was Never Pushed​

levels-unpushed is a second project, set up like river-levels except for one thing: its .dvc file was committed, but dvc push was never run. In its clone, levels-unpushed-copy, dvc pull fails:

Terminal
dvc pull
Output
Collecting |0.00 [00:00, ?entry/s]
WARNING: Some of the cache files do not exist neither locally nor on remote. Missing cache files:
md5: 93e7b70f5ab826742af97a740c68a12a
Fetching
Building workspace index |1.00 [00:00, 1.07kentry/s]
Comparing indexes |3.00 [00:00, 3.29kentry/s]
Applying changes |0.00 [00:00, ?file/s]
Everything is up to date.
ERROR: failed to pull data from the cloud - Checkout failed for following targets:
data/levels.csv
Is your cache up to date?
<https://error.dvc.org/missing-files>

The terminal after dvc pull in a clone whose data was never pushed: a warning about missing cache files, Everything is up to date, and then the error failed to pull data from the cloud for data/levels.csv.

The warning names the cause: the file with hash 93e7b70f… is neither in this clone's cache nor in the remote. Don't trust Everything is up to date.: the command failed, with exit code 1, and data/levels.csv is still missing. I reported that misleading line to the DVC project as treeverse/dvc#11162.

The address in the error leads to DVC's troubleshooting page, which says: "The most common cause is changes pushed to Git without the corresponding data being uploaded to the DVC remote. Make sure to dvc push from the original project, and try again." So push from the original project:

Terminal
cd ../levels-unpushed
dvc push
Output
Collecting |1.00 [00:00, 820entry/s]
Pushing
1 file pushed

Then pull in the clone again:

Terminal
cd ../levels-unpushed-copy
dvc pull
Output
Collecting |0.00 [00:00, ?entry/s]
Fetching
Building workspace index |1.00 [00:00, 335entry/s]
Comparing indexes |3.00 [00:00, 3.59kentry/s]
Applying changes |1.00 [00:00, 1.04kfile/s]
A data/levels.csv
1 file fetched and 1 file added

The terminal after dvc push in the original project, which pushes 1 file, and dvc pull in the clone, which now adds data/levels.csv.

The file arrived. If you can't run dvc push in the original project yourself, ask whoever committed the .dvc file to run it.

Common Mistakes​

MistakeWhat happensDo this instead
Opening the data right after git cloneThe data files aren't there, only their .dvc filesdvc pull after every clone
Trusting Everything is up to date. in a failed pullThe data is still missingCheck the last line: ERROR means the pull failed
Committing .dvc files without dvc pushClones can't download the datadvc push from the original project

Troubleshooting​

SymptomLikely causeFix
Some of the cache files do not exist neither locally nor on remoteThe data was never pushed to this remotedvc push in the original project, then dvc pull again
failed to pull data from the cloud - Checkout failed for following targetsThe same: the file couldn't be downloadedThe same
no remote specifiedThe project has no default remoteSet one: see the local folder remote guide

FAQ​

What's the difference between dvc pull and dvc fetch?​

dvc fetch only downloads into the cache. dvc pull also puts the files in the project folder: the reference says it "has the same effect as running dvc fetch and dvc checkout".

Do I still need git pull?​

Yes. The reference says: "pulling data does not affect code, dvc.yaml, or .dvc files. Those should be downloaded with git pull." Run git pull first, then dvc pull for the data its .dvc files point to.

Can I pull only one file?​

Yes, give its path. The reference says: "Any targets given to this command limit what to pull."

Conclusion​

The clone had data/levels.csv.dvc but no data, and dvc pull fetched the file from the remote into the cache and put it in place: 1 file fetched and 1 file added. dvc status confirmed it, and a second pull downloaded nothing. When the data was never pushed, the pull failed until dvc push ran in the original project.

Additional Resources​

  • dvc pull — every option, including -r, --force and targets.
  • Troubleshooting — "Failed to pull data from the cloud".