Skip to content

clone: support creating mirrors #204

@efiop

Description

@efiop

We've been discussing clone caching before multiple times (e.g. in #41) and it always seemed pretty involved with unshallowing and other potential conflicts.

Seems like we could introduce a mirror concept that would allow you to establish your local cached "mirror" with multiple repos cached by token(url)(or smth like that) and that would use git clone's --mirror flag.

E.g. in dvc we would create our mirror (say in platformdirs.site_cache_dir to avoid strange nfs/cifs/etc problems) and would use it to clone stuff we need:

from scmrepo import Mirror

mirror = Mirror(platformdirs.site_cache_dir(...))

repo = mirror.clone("https://github.com/iterative/example-get-started", ...)
...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions