From 6763496dc16ef2af5abfca2dc3416bf38e8fac87 Mon Sep 17 00:00:00 2001 From: Nathaniel Furniss Date: Wed, 20 Oct 2021 06:21:11 -0700 Subject: [PATCH] refactor: perform shallow clone during deploy (#5748) Co-authored-by: slorber --- packages/docusaurus/src/commands/deploy.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/docusaurus/src/commands/deploy.ts b/packages/docusaurus/src/commands/deploy.ts index 6e94f302ad..9bb5c3f657 100644 --- a/packages/docusaurus/src/commands/deploy.ts +++ b/packages/docusaurus/src/commands/deploy.ts @@ -167,7 +167,9 @@ Try using DEPLOYMENT_BRANCH=main or DEPLOYMENT_BRANCH=master`); const toPath = await fs.mkdtemp( path.join(os.tmpdir(), `${projectName}-${deploymentBranch}`), ); - if (shellExecLog(`git clone ${remoteBranch} ${toPath}`).code !== 0) { + if ( + shellExecLog(`git clone --depth 1 ${remoteBranch} ${toPath}`).code !== 0 + ) { throw new Error(`Running "git clone" command in "${toPath}" failed.`); }