Shared cache without commiting


As far as i understand, when I setup a shared cache directory, I have to commit it and others also have to use it.
Is there a way that I can define a shared cache dir for me only?

Use Cases:

  • I have a project, where I want to run jobs from two branches simultaneously. So I need to clone the repo twice, but only want the cache to exist once.
  • I have projects with similar data dependencies and I want to share the cache between both projects.

Is it possible or do you have any other recommendations for my use cases?

Thanks and Regards

Hi @ynop !

Sure, it is possible and it is no different from what you would use when working with colleagues like described in this article . You can also specify the same shared directory for multiple different projects just as you’ve described in your use case.


Thanks for the prompt reply!

But is it also possible to define the shared cache folder without exposing it to my colleagues via git?

Since I want to share my cache for multiple projects, but my colleagues may using an other directory on another machine.

Sure. There is a local config that is designed specifically for such cases of private configs. It is not tracked by git and has priority over regular config. To use your local config, just add --local flag to your dvc config commands and it will write to .dvc/config.local instead of .dvc/config.