Checkout depth

git

#1

Hi all,

It seems to me checkout extremely slow. Our project has a big commit history ( ~800 MB) so CircleCI clones all the history for every commit/PR. Perhaps it would benefit from using the --depth=1 option to git clone? Can we customize the checkout step?

Thank you


#2

+1

Is there a way that we can customize the checkout step so that we can add the --depth=1 option when the repo is being cloned.


#3

If you need this straight away, I expect it would not be all that hard to create a shallow Git mirror of your project, and then build from the mirror. You might have to do some extra stuff to trigger builds, using the API, but doing so will get you this feature now, rather than at some indeterminate point in the future (or never).


#4

The checkout step is optional in 2.0, so what you should do is not use the built in checkout key and instead make a custom command that does --depth=1.


#5

I this case we need independently implement ssh keys managing logic, amending known hosts by hand and do a lot of other work. Please take a look at checkout script (what it does).


#6

I was surprised by this too and found some discussion in https://circleci.com/docs/2.0/caching/#source-caching. A bare checkout might be faster still but source caching should at least reduce the frequency with which you need to perform a full clone.


#7

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.