Skip to content

Commit 063e9ef

Browse files
Daniel Gerberclaude
andcommitted
Speed up getDocs clones with shallow, single-branch fetch
getDocs.js only needs a snapshot of each upstream repo's docs, but it did a full clone (entire history, all branches). Add --depth 1 and --single-branch so each clone transfers only the latest commit of the default branch, cutting fetch time and bandwidth noticeably for the larger source repositories. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Daniel Gerber <394442-gerbsen@users.noreply.gitlab.com>
1 parent 32a9cd6 commit 063e9ef

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

getDocs.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ const ghUrl = 'https://github.com/'
1414
repos.forEach((repo) => {
1515
const repoDir = `repo_to_be_edited/${repo.label}`
1616

17-
// Clone the repository
18-
const cloneCommand = `git clone ${ghUrl + repo.repo} ${repoDir}`
17+
// Clone the repository (shallow, single branch — we only need a snapshot of the docs)
18+
const cloneCommand = `git clone --single-branch --depth 1 ${
19+
ghUrl + repo.repo
20+
} ${repoDir}`
1921
execSync(cloneCommand)
2022

2123
// Remove git folders

0 commit comments

Comments
 (0)