diff --git a/src/cli/commands/sync.ts b/src/cli/commands/sync.ts index 9281dc9..1a739ab 100644 --- a/src/cli/commands/sync.ts +++ b/src/cli/commands/sync.ts @@ -158,10 +158,11 @@ export async function pushApp(options: { quiet?: boolean } = {}) { } } - // Files to delete (exist on server but not locally) + // Files to delete (exist on server but not locally, respecting gitignore) + const gitignore = loadGitignore(process.cwd()) const toDelete: string[] = [] for (const file of remoteFiles) { - if (!localFiles.has(file)) { + if (!localFiles.has(file) && !gitignore.shouldExclude(file)) { toDelete.push(file) } } @@ -1008,10 +1009,11 @@ async function getManifestDiff(appName: string): Promise { } } - // Files only in remote + // Files only in remote (filtered by local gitignore) + const gitignore = loadGitignore(process.cwd()) const remoteOnly: string[] = [] for (const file of remoteFiles) { - if (!localFiles.has(file)) { + if (!localFiles.has(file) && !gitignore.shouldExclude(file)) { remoteOnly.push(file) } }