# Clear local cache completely and rely on remote

**URL:** <https://discuss.dvc.org/t/clear-local-cache-completely-and-rely-on-remote/596>\
**Category:** Questions\
**Created:** [December 18, 2020, 11:47am UTC](https://discuss.dvc.org/t/clear-local-cache-completely-and-rely-on-remote/596 "2020-12-18T11:47:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davlid](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@davlid](https://discuss.dvc.org/u/davlid)\
**Post date:** [December 18, 2020, 11:47am UTC](https://discuss.dvc.org/t/clear-local-cache-completely-and-rely-on-remote/596/1 "2020-12-18T11:47:46Z")

</div>

Hi!

First off thanks for a great tool! While we don’t use the pipelines very much, we do use DVC to store our data in my team, several sets of 100s of GBs each.

I often work with one data set at the time, usually for several weeks. It would be nice to be able to clear the data sets not currently in use completely from my local machine. We use a monorepo for everything, and if I understand gc correctly, the reason my cache doesn’t get cleared is because there are .dvc files of all sets in the branch head.

Since there are some datasets I almost never use, it would be nice to be able to clear them completely from the local cache and then once i need it I’ll take my punishment and wait for it to download from the remote using dvc pull. My question, I guess, is if there is a nice way of doing this that I’m missing? Currently I’ve resorted to manually deleting everything i the cache folder every few months to start fresh and pull what I need. It works but doesn’t feel like the correct way to go about it.

All the best!

---

<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:** [December 18, 2020, 3:08pm UTC](https://discuss.dvc.org/t/clear-local-cache-completely-and-rely-on-remote/596/2 "2020-12-18T15:08:48Z")

</div>

Hi @davlid !

Deleting the cache dir and then pulling what you want is a pretty good workaround 😉 But I suppose you want to be able to tell `gc` that you want to keep only some specific dvcfiles? Kinda like you `dvc pull data` right now.

---

<div class="post-metadata">

**Author:** ![davlid](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@davlid](https://discuss.dvc.org/u/davlid)\
**Post date:** [December 18, 2020, 6:27pm UTC](https://discuss.dvc.org/t/clear-local-cache-completely-and-rely-on-remote/596/3 "2020-12-18T18:27:50Z")

</div>

Hi!

Yeah hehe, it seems to work fine, it just didn’t seem like the proper way to go about it so I mainly wondered if I had missed something but I’m happy to stick with this then.

An additional option to gc would be nice, yes! Telling gc to keep only the listed targets in cache, regardless of whether there are .dvc files pointing to them or not. Maybe also check to only clear cache that have been pushed to the remote, but I don’t know if that is expensive to check.

Many 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:** [December 18, 2020, 8:10pm UTC](https://discuss.dvc.org/t/clear-local-cache-completely-and-rely-on-remote/596/4 "2020-12-18T20:10:04Z")

</div>

Makes sense! We have a ticket [https://github.com/iterative/dvc/issues/2036](https://github.com/iterative/dvc/issues/2036) for cleaning up local cache if it is already present on remote. And we have a more generic ticket about revisiting gc [https://github.com/iterative/dvc/issues/2325](https://github.com/iterative/dvc/issues/2325) where we also discuss ways to cleanup particular data. Glad that the current workaround works fine for you, we’ll be adding an option for that in the future, so stay tuned 😉 Thanks for the feedback!
