Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use shallow clone to improve performance when cloning huge repos #201

Closed
sorenlouv opened this issue Jun 4, 2020 · 2 comments · Fixed by #293
Closed

Use shallow clone to improve performance when cloning huge repos #201

sorenlouv opened this issue Jun 4, 2020 · 2 comments · Fixed by #293

Comments

@sorenlouv
Copy link
Owner

Cloning a big repository like Kibana can be very slow and take several minutes. To improve this it might make sense to shallow clone the repository

git clone https://github.com/elastic/kibana.git --depth=100

This will only fetch the most recent commit from the default branch and is thus much faster than cloning the entire history for all branches.

git fetch --update-head-ok origin 7.x:7.x --depth=1
@sorenlouv sorenlouv changed the title Use shallow clone to improve performance of huge repos Use shallow clone to improve performance when cloning huge repos Jun 4, 2020
@ankush
Copy link
Contributor

ankush commented May 18, 2021

Another option would be using the existing repository. E.g. wherever you're making a copy first do git clone /home/user/folder.. and then you can change the origin. This way it's much faster to clone.

@sorenlouv
Copy link
Owner Author

@ankush that's a great idea too 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants