[Fixed] Big repo, how to save the git clone time?

I have a big git repository, nearly 2GB. So every time, drone agent takes more than 2 minutes to clone the repo before any build job.

Are there any ways to reduce the clone time, without ask me to reduce the repo size?


Do you use the plugin restore-cache? And share your YML file, please.


Thanks @rsareth

There is no yml for git clone in Drone, that’s default action in drone.

I will find out how to use plugin restore-cache, if it is helpful.

Spent some time on docker plugin restore-cache

    image: drillster/drone-volume-cache
    restore: true
      - ./node_modules
      - /tmp/cache:/cache

This pipeline runs after git clone, if I need let plugin/git or plugin/hg know the option (restore: true or rebuild: true), I need to adjust the git or hg plugin directly.

Let me have a try.

For me, most obvious answer would be using depth git option, if there were artifacts/larger than usual files before, but not now.



I’m pulling a git repo of similar size. I’m using:

    image: plugins/git
    depth: 1

Apples to oranges, but it takes 33s. Of course, I have LFS objects to pull after that. It should be the most performant option. Good luck!

1 Like

Sorry for the late response. Your configuration looks good.

Did it work?

Finally I realised that repo is mercurial repository, which doesn’t support depth option.

But I think it should work with git repo.