From 88f9236d50ca468a86ebb5377ffa762abf410235 Mon Sep 17 00:00:00 2001 From: Lovepreet Singh Date: Sun, 12 Jul 2026 03:30:08 +0530 Subject: [PATCH] fix: ignore .git folder on template download Fixes #11978. When downloading a template, specifically via --template-url, we should ensure the .git directory is not included so the new project doesn't inherit the remote of the template. --- packages/sf-core/src/utils/https/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/sf-core/src/utils/https/index.js b/packages/sf-core/src/utils/https/index.js index 0a9d2932738..438b218bd52 100644 --- a/packages/sf-core/src/utils/https/index.js +++ b/packages/sf-core/src/utils/https/index.js @@ -391,6 +391,9 @@ export const downloadTemplate = async (inputUrl, newTemplateName) => { path.join(newServicePath, 'serverless.template.yml'), ) + // Remove .git if it exists + await removeFileOrDirectory(path.join(newServicePath, '.git')) + return newServicePath }