# Dvc pull --glob

**URL:** <https://discuss.dvc.org/t/dvc-pull-glob/917>\
**Category:** Questions\
**Created:** [October 14, 2021, 1:50pm UTC](https://discuss.dvc.org/t/dvc-pull-glob/917 "2021-10-14T13:50:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimmy](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jimmy](https://discuss.dvc.org/u/jimmy)\
**Post date:** [October 14, 2021, 1:50pm UTC](https://discuss.dvc.org/t/dvc-pull-glob/917/1 "2021-10-14T13:50:44Z")

</div>

Hi, I want to share just some of my files on a remote. For that I used `dvc push --glob data/ **/*.txt data `, which seemed to work. But how can someone download and checkout only this subset? All other data files are stored just locally and were never pushed. The command `dvc pull --glob data/** /*.txt` throws a lot of errors, because dvc tries to download files from the remote that I never uploaded.  
Thanks

---

<div class="post-metadata">

**Author:** ![kupruser](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kupruser](https://discuss.dvc.org/u/kupruser)\
**Post date:** [October 15, 2021, 9:37pm UTC](https://discuss.dvc.org/t/dvc-pull-glob/917/2 "2021-10-15T21:37:10Z")

</div>

Hi!

`--glob` right now has a very limited functionality, and it is only working on local files, even for `dvc pull`. However `dvc pull` supports specific targets (e.g. specific directory or specific file). Full glob support will be coming sometime in the future.

---

<div class="post-metadata">

**Author:** ![jimmy](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jimmy](https://discuss.dvc.org/u/jimmy)\
**Post date:** [October 18, 2021, 5:55am UTC](https://discuss.dvc.org/t/dvc-pull-glob/917/3 "2021-10-18T05:55:08Z")

</div>

Hi,  
if I understand that correctly, by now, it is possible to download a single folder or file but not a subset of a folder (with a glob expression). Is that correct?  
Thanks

---

<div class="post-metadata">

**Author:** ![kupruser](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kupruser](https://discuss.dvc.org/u/kupruser)\
**Post date:** [October 18, 2021, 2:14pm UTC](https://discuss.dvc.org/t/dvc-pull-glob/917/4 "2021-10-18T14:14:31Z")

</div>

Correct. E.g. `dvc pull path/to/datafile`, `dvc pull path/to/datadir/path/to/subdir`, `dvc pull path/to/datadir/path/to/subdir/subfile`, etc

---

<div class="post-metadata">

**Author:** ![xyz](https://avatars.discourse-cdn.com/v4/letter/x/b5a626/32.png) [@xyz](https://discuss.dvc.org/u/xyz)\
**Post date:** [July 28, 2022, 3:52pm UTC](https://discuss.dvc.org/t/dvc-pull-glob/917/5 "2022-07-28T15:52:06Z")

</div>

Is there any update to this? I have lots of folders with lots of images and metadata files. I just need the metadata files from the remote.

---

<div class="post-metadata">

**Author:** ![skshetry](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@skshetry](https://discuss.dvc.org/u/skshetry)\
**Post date:** [July 30, 2022, 3:22pm UTC](https://discuss.dvc.org/t/dvc-pull-glob/917/6 "2022-07-30T15:22:11Z")

</div>

Unfortunately, we have not been able to implement it yet. Please subscribe to [pull: glob should not depend on what's in the workspace · Issue #7491 · iterative/dvc · GitHub](https://github.com/iterative/dvc/issues/7491) for any updates. Thanks.

---

<div class="post-metadata">

**Author:** ![drjasonharrison](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/drjasonharrison/32/148_2.png) [@drjasonharrison](https://discuss.dvc.org/u/drjasonharrison)\
**Post date:** [October 17, 2022, 11:23pm UTC](https://discuss.dvc.org/t/dvc-pull-glob/917/7 "2022-10-17T23:23:07Z")

</div>

@skshetry unfortunately issue 7491 has been closed as a duplicate of [#5864](https://github.com/iterative/dvc/issues/5864). So interested parties should subscribe to #5864.

---

<div class="post-metadata">

**Author:** ![drjasonharrison](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/drjasonharrison/32/148_2.png) [@drjasonharrison](https://discuss.dvc.org/u/drjasonharrison)\
**Post date:** [October 17, 2022, 11:30pm UTC](https://discuss.dvc.org/t/dvc-pull-glob/917/8 "2022-10-17T23:30:45Z")

</div>

Is the only current workaround to this issue to use a shell script to pull the files we want?

- assume the git repo is fully checked out
- the script is given a combination of a path and file pattern (possibly in quotes)
  - for all .dvc files at the path:
    - script removes the .dvc extension from each file and checks the pattern against the filename or path
    - script performs dvc pull for the specific file

extra points:

- parse each .dvc file for the outs/path and compare that value against the filename or path.

---

<div class="post-metadata">

**Author:** ![YanxiangGao](https://avatars.discourse-cdn.com/v4/letter/y/f04885/32.png) [@YanxiangGao](https://discuss.dvc.org/u/YanxiangGao)\
**Post date:** [October 18, 2022, 9:35am UTC](https://discuss.dvc.org/t/dvc-pull-glob/917/9 "2022-10-18T09:35:24Z")

</div>

> Is the only current workaround to this issue to use a shell script to pull the files we want?  
> Yes, because we only implement a very naive `glob` , it can only match what had already been in your workspace, this is useful in `dvc push` or `dvc add` but for the `dvc pull` outputs will not exist in your workspace only after you already pulled them down.
