# Pull only files belonging to a specific remote?

**URL:** <https://discuss.dvc.org/t/pull-only-files-belonging-to-a-specific-remote/1744>\
**Category:** Questions\
**Created:** [August 28, 2023, 9:02am UTC](https://discuss.dvc.org/t/pull-only-files-belonging-to-a-specific-remote/1744 "2023-08-28T09:02:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stianlagstad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/stianlagstad/32/264_2.png) [@stianlagstad](https://discuss.dvc.org/u/stianlagstad)\
**Post date:** [August 28, 2023, 9:02am UTC](https://discuss.dvc.org/t/pull-only-files-belonging-to-a-specific-remote/1744/1 "2023-08-28T09:02:24Z")

</div>

Is it possible to pull only files belonging to specific remotes?

I have an example `reference-data.dvc` file where I’ve added the remote field, specifying “reference-data” as the value. However, when I run `dvc pull -r test-data`, then that `reference-data.dvc` data is still being pulled. Even though that .dvc file is specifically specified to belong to the “reference-data” remote. I believe this happens because the “test-data” remote wrongly also contains the data that’s in the `reference-data.dvc` file. However, even so, I don’t want that pull to happen because I’m only interested in the “test-data”. How can I accomplish this? I wish to pull all files belonging to a specific remote, without having to manually find those .dvc files and pull them explicitly.

This question is spun off from [How to configure that specific files should go to different remotes with DVC? - Stack Overflow](https://stackoverflow.com/questions/76951535/how-to-configure-that-specific-files-should-go-to-different-remotes-with-dvc/76956283?noredirect=1#comment135707520_76956283).

---

<div class="post-metadata">

**Author:** ![shcheklein](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/shcheklein/32/173_2.png) [@shcheklein](https://discuss.dvc.org/u/shcheklein)\
**Post date:** [August 28, 2023, 4:30pm UTC](https://discuss.dvc.org/t/pull-only-files-belonging-to-a-specific-remote/1744/2 "2023-08-28T16:30:23Z")

</div>

Hey, here is the discussion on this in this ticket [pull: how to only download data from a specified remote? · Issue #8298 · iterative/dvc · GitHub](https://github.com/iterative/dvc/issues/8298#issuecomment-1695581704) . Please come and chime in.

As @daavoo suggested, you could also try to use a custom script:

```python
import os
from dvc.repo import Repo
repo = Repo()
outs = [
    os.path.relpath(out.fs_path, repo.root_dir)
    for out in repo.index.outs 
    if out.remote == "storage"
]
repo.pull(outs, allow_missing=True)

```
