Skip to content

Speed up initial docs generation by setting the git clone depth to 1. #2093

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

Merged
merged 2 commits into from
Jun 12, 2025

Conversation

alexgmin
Copy link
Contributor

For the docs generation on a new setup, which is when the .git folder doesn't exist, there's no need to clone the entire repo history.
Setting the clone depth to 1 and just pulling the last commit, speeds the initial clone process quite a bit.

This shouldn't change anything for existing docs setups.

Copy link
Member

@CuriousLearner CuriousLearner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🌮

Copy link
Member

@bmispelon bmispelon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it locally and it made update_docs on a clean checkout go from 2min45s to 1min58s.

Nice work 👍🏻

@sabderemane sabderemane merged commit 5afbcb0 into django:main Jun 12, 2025
4 checks passed
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 this pull request may close these issues.

6 participants